Skip to content
Permalink
Browse files

added test cases for ordinal helper

  • Loading branch information...
ritesh-pandey committed Sep 2, 2015
1 parent 2021de1 commit 7cc2dc4b8f61729ae5b683c925ce17adeb6c1fe5
Showing with 28 additions and 0 deletions.
  1. +28 −0 tests/TestCase/I18n/NumberTest.php
@@ -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.
You can’t perform that action at this time.