summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGeorge PETCULESCU <george.petculescu@zitec.com>2016-11-01 10:19:24 +0100
committerGeorge PETCULESCU <george.petculescu@zitec.com>2016-11-01 10:19:24 +0100
commitb18492be397373de452999f34a200cc24fb751ed (patch)
tree19b89bbce523a9b6b5f38941fb337722277592b7 /tests
parent84f5366a8d76fe935a57cb9dbf61c970d98a0a27 (diff)
added tests for ordinal_format() helper function (Inflector helper)
Diffstat (limited to 'tests')
-rw-r--r--tests/codeigniter/helpers/inflector_helper_test.php19
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..a5bb80532 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 => '1th',
+ 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