From 7b5122adb19615e8e740b688164d0d259aff668f Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 17 Jul 2013 10:04:29 -0400 Subject: [PATCH] Fix pluralization of Objective. Fixes #3921 --- lib/Cake/Test/Case/Utility/InflectorTest.php | 2 ++ lib/Cake/Utility/Inflector.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Utility/InflectorTest.php b/lib/Cake/Test/Case/Utility/InflectorTest.php index dc923d63f..337830deb 100644 --- a/lib/Cake/Test/Case/Utility/InflectorTest.php +++ b/lib/Cake/Test/Case/Utility/InflectorTest.php @@ -117,6 +117,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::singularize('teeth'), 'tooth'); $this->assertEquals(Inflector::singularize('geese'), 'goose'); $this->assertEquals(Inflector::singularize('feet'), 'foot'); + $this->assertEquals(Inflector::singularize('objectives'), 'objective'); $this->assertEquals(Inflector::singularize(''), ''); } @@ -177,6 +178,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::pluralize('tooth'), 'teeth'); $this->assertEquals(Inflector::pluralize('goose'), 'geese'); $this->assertEquals(Inflector::pluralize('foot'), 'feet'); + $this->assertEquals(Inflector::pluralize('objective'), 'objectives'); $this->assertEquals(Inflector::pluralize(''), ''); } diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php index 577bd0ad2..069eb2da9 100644 --- a/lib/Cake/Utility/Inflector.php +++ b/lib/Cake/Utility/Inflector.php @@ -125,9 +125,9 @@ class Inflector { '/(m)ovies$/i' => '\1\2ovie', '/(s)eries$/i' => '\1\2eries', '/([^aeiouy]|qu)ies$/i' => '\1y', + '/(tive)s$/i' => '\1', '/([lre])ves$/i' => '\1f', '/([^fo])ves$/i' => '\1fe', - '/(tive)s$/i' => '\1', '/(hive)s$/i' => '\1', '/(drive)s$/i' => '\1', '/(^analy)ses$/i' => '\1sis',