Skip to content

Commit

Permalink
Makes the locale test not always pass, be verbose when it is skipped.
Browse files Browse the repository at this point in the history
  • Loading branch information
Phally committed Aug 14, 2013
1 parent cd96ef9 commit 6f74e19
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Cake/Test/Case/Utility/CakeNumberTest.php
Expand Up @@ -587,12 +587,14 @@ public function testToReadableSize() {
*/
public function testReadableSizeLocalized() {
$restore = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, 'de_DE');

$this->skipIf(setlocale(LC_NUMERIC, 'de_DE') === false, "The German locale isn't available.");

$result = $this->Number->toReadableSize(1321205);
$this->assertRegExp('/1[,.]26 MB/', $result);
$this->assertEquals('1,26 MB', $result);

$result = $this->Number->toReadableSize(1024 * 1024 * 1024 * 512);
$this->assertRegExp('/512[,.]00 GB/', $result);
$this->assertEquals('512,00 GB', $result);
setlocale(LC_NUMERIC, $restore);
}

Expand Down

0 comments on commit 6f74e19

Please sign in to comment.