From 2893b29e1148b58122b940fb4a1197f96c65f2e9 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 10 Aug 2009 21:29:01 -0400 Subject: [PATCH] Fixing inflection of Taxes. Fixes #15 --- cake/libs/inflector.php | 2 +- cake/tests/cases/libs/inflector.test.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 550d30ced..92fdbbe4f 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -124,7 +124,7 @@ class Inflector extends Object { '/^(ox)en/i' => '\1', '/(alias)(es)*$/i' => '\1', '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us', - '/([ftw]ax)es/' => '\1', + '/([ftw]ax)es/i' => '\1', '/(cris|ax|test)es$/i' => '\1is', '/(shoe|slave)s$/i' => '\1', '/(o)es$/i' => '\1', diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 13f71c071..375f56859 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -109,6 +109,7 @@ class InflectorTest extends CakeTestCase { $this->assertEqual(Inflector::singularize('shelves'), 'shelf'); $this->assertEqual(Inflector::singularize('taxis'), 'taxi'); $this->assertEqual(Inflector::singularize('taxes'), 'tax'); + $this->assertEqual(Inflector::singularize('Taxes'), 'Tax'); $this->assertEqual(Inflector::singularize('faxes'), 'fax'); $this->assertEqual(Inflector::singularize('waxes'), 'wax'); $this->assertEqual(Inflector::singularize('niches'), 'niche'); @@ -156,6 +157,7 @@ class InflectorTest extends CakeTestCase { $this->assertEqual(Inflector::pluralize('people'), 'people'); $this->assertEqual(Inflector::pluralize('glove'), 'gloves'); $this->assertEqual(Inflector::pluralize('crisis'), 'crises'); + $this->assertEqual(Inflector::pluralize('tax'), 'taxes'); $this->assertEqual(Inflector::pluralize(''), ''); }