Skip to content

Commit

Permalink
added test cases for ordinal helper
Browse files Browse the repository at this point in the history
  • Loading branch information
ritesh-pandey committed Sep 2, 2015
1 parent 2021de1 commit 7cc2dc4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/TestCase/I18n/NumberTest.php
Expand Up @@ -538,4 +538,32 @@ public function testReadableSizeLocalized()
$result = $this->Number->toReadableSize(512.05 * 1024 * 1024 * 1024);
$this->assertEquals('512,05 GB', $result);
}

/**
* test ordinal() with locales
*
* @return void
*/
public function testOrdinal()
{
I18n::locale('en_US');
$result = $this->Number->ordinal(1);
$this->assertEquals('1st', $result);

$result = $this->Number->toReadableSize(2);
$this->assertEquals('2nd', $result);

$result = $this->Number->toReadableSize(3);
$this->assertEquals('3rd', $result);

$result = $this->Number->toReadableSize(4);
$this->assertEquals('4th', $result);

I18n::locale('fr_FR');
$result = $this->Number->toReadableSize(1);
$this->assertEquals('1er', $result);

$result = $this->Number->toReadableSize(2);
$this->assertEquals('2e', $result);
}
}

0 comments on commit 7cc2dc4

Please sign in to comment.