From b18492be397373de452999f34a200cc24fb751ed Mon Sep 17 00:00:00 2001 From: George PETCULESCU Date: Tue, 1 Nov 2016 11:19:24 +0200 Subject: added tests for ordinal_format() helper function (Inflector helper) --- tests/codeigniter/helpers/inflector_helper_test.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- cgit v1.2.3-24-g4f1b From b2c3a0063d02edfec79ab9aa5619c9f40cdd21d0 Mon Sep 17 00:00:00 2001 From: George PETCULESCU Date: Tue, 1 Nov 2016 11:22:38 +0200 Subject: small typo --- tests/codeigniter/helpers/inflector_helper_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/codeigniter/helpers/inflector_helper_test.php b/tests/codeigniter/helpers/inflector_helper_test.php index a5bb80532..4a1e64fae 100644 --- a/tests/codeigniter/helpers/inflector_helper_test.php +++ b/tests/codeigniter/helpers/inflector_helper_test.php @@ -101,7 +101,7 @@ class Inflector_helper_test extends CI_TestCase { 1 => '1st', 2 => '2nd', 4 => '4th', - 11 => '1th', + 11 => '11th', 12 => '12th', 13 => '13th', 'something else' => 'something else', -- cgit v1.2.3-24-g4f1b