diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 19327e54c..dc0ee0ade 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -214,6 +214,7 @@ class Inflector extends Object { '/(cris|ax|test)es$/i' => '\1is', '/(shoe)s$/i' => '\1', '/(o)es$/i' => '\1', + '/ouses$/' => 'ouse', '/uses$/' => 'us', '/([m|l])ice$/i' => '\1ouse', '/(x|ch|ss|sh)es$/i' => '\1', diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index f770dc154..1057f0e59 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -49,6 +49,10 @@ class InflectorTest extends UnitTestCase { $expected = 'house'; $this->assertEqual($result, $expected); + $result = $this->inflector->singularize('powerhouses'); + $expected = 'powerhouse'; + $this->assertEqual($result, $expected); + $result = $this->inflector->singularize('quizzes'); $expected = 'quiz'; $this->assertEqual($result, $expected); @@ -79,10 +83,14 @@ class InflectorTest extends UnitTestCase { } function testInflectingPlurals() { - $result = $this->inflector->singularize('house'); + $result = $this->inflector->pluralize('house'); $expected = 'houses'; $this->assertEqual($result, $expected); + $result = $this->inflector->pluralize('powerhouse'); + $expected = 'powerhouses'; + $this->assertEqual($result, $expected); + $result = $this->inflector->pluralize('Bus'); $expected = 'Buses'; $this->assertEqual($result, $expected);