Permalink
Browse files

Makes the locale test not always pass, be verbose when it is skipped.

  • Loading branch information...
1 parent cd96ef9 commit 6f74e1958b116ad032fc8e5c5a7181148f0ae9bd @Phally Phally committed Aug 14, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/Cake/Test/Case/Utility/CakeNumberTest.php
View
8 lib/Cake/Test/Case/Utility/CakeNumberTest.php
@@ -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);
}

0 comments on commit 6f74e19

Please sign in to comment.