diff options
author | Andrey Andreev <narf@devilix.net> | 2016-11-01 11:23:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-01 11:23:53 +0100 |
commit | 52d264d960aded1620ae8505e2935de12b0209e9 (patch) | |
tree | 65a60ece1f80cc480c1dcb9e5a34f63a8f1a5f40 | |
parent | 84f5366a8d76fe935a57cb9dbf61c970d98a0a27 (diff) | |
parent | b2c3a0063d02edfec79ab9aa5619c9f40cdd21d0 (diff) |
Merge pull request #4895 from gxgpet/develop_01112016
Unit-testing for ordinal_format() (Inflector helper)
-rw-r--r-- | tests/codeigniter/helpers/inflector_helper_test.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/codeigniter/helpers/inflector_helper_test.php b/tests/codeigniter/helpers/inflector_helper_test.php index 81ce5e394..4a1e64fae 100644 --- a/tests/codeigniter/helpers/inflector_helper_test.php +++ b/tests/codeigniter/helpers/inflector_helper_test.php @@ -93,4 +93,23 @@ class Inflector_helper_test extends CI_TestCase { } } + // -------------------------------------------------------------------- + + public function test_ordinal_format() + { + $strs = array( + 1 => '1st', + 2 => '2nd', + 4 => '4th', + 11 => '11th', + 12 => '12th', + 13 => '13th', + 'something else' => 'something else', + ); + + foreach ($strs as $str => $expect) + { + $this->assertEquals($expect, ordinal_format($str)); + } + } }
\ No newline at end of file |