Correct inflection rules for cookies, fixes fixes #3291

This commit is contained in:
Jose Lorenzo Rodriguez 2012-10-22 23:07:42 +02:00
parent 08556ab879
commit 9dc3b243ac
2 changed files with 4 additions and 1 deletions

View file

@ -109,6 +109,7 @@ class InflectorTest extends CakeTestCase {
$this->assertEquals(Inflector::singularize('roofs'), 'roof'); $this->assertEquals(Inflector::singularize('roofs'), 'roof');
$this->assertEquals(Inflector::singularize('foes'), 'foe'); $this->assertEquals(Inflector::singularize('foes'), 'foe');
$this->assertEquals(Inflector::singularize('databases'), 'database'); $this->assertEquals(Inflector::singularize('databases'), 'database');
$this->assertEquals(Inflector::singularize('cookies'), 'cookie');
$this->assertEquals(Inflector::singularize(''), ''); $this->assertEquals(Inflector::singularize(''), '');
} }
@ -160,6 +161,7 @@ class InflectorTest extends CakeTestCase {
$this->assertEquals(Inflector::pluralize('cafe'), 'cafes'); $this->assertEquals(Inflector::pluralize('cafe'), 'cafes');
$this->assertEquals(Inflector::pluralize('roof'), 'roofs'); $this->assertEquals(Inflector::pluralize('roof'), 'roofs');
$this->assertEquals(Inflector::pluralize('foe'), 'foes'); $this->assertEquals(Inflector::pluralize('foe'), 'foes');
$this->assertEquals(Inflector::pluralize('cookie'), 'cookie');
$this->assertEquals(Inflector::pluralize(''), ''); $this->assertEquals(Inflector::pluralize(''), '');
} }

View file

@ -55,7 +55,7 @@ class Inflector {
'/$/' => 's', '/$/' => 's',
), ),
'uninflected' => array( 'uninflected' => array(
'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people' '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people', 'cookie'
), ),
'irregular' => array( 'irregular' => array(
'atlas' => 'atlases', 'atlas' => 'atlases',
@ -63,6 +63,7 @@ class Inflector {
'brother' => 'brothers', 'brother' => 'brothers',
'cafe' => 'cafes', 'cafe' => 'cafes',
'child' => 'children', 'child' => 'children',
'cookie' => 'cookies',
'corpus' => 'corpuses', 'corpus' => 'corpuses',
'cow' => 'cows', 'cow' => 'cows',
'ganglion' => 'ganglions', 'ganglion' => 'ganglions',