Skip to content

Commit

Permalink
Correct inflection rules for cookies, fixes fixes #3291
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 22, 2012
1 parent 08556ab commit 9dc3b24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/Cake/Test/Case/Utility/InflectorTest.php
Expand Up @@ -109,6 +109,7 @@ public function testInflectingSingulars() {
$this->assertEquals(Inflector::singularize('roofs'), 'roof');
$this->assertEquals(Inflector::singularize('foes'), 'foe');
$this->assertEquals(Inflector::singularize('databases'), 'database');
$this->assertEquals(Inflector::singularize('cookies'), 'cookie');

$this->assertEquals(Inflector::singularize(''), '');
}
Expand Down Expand Up @@ -160,6 +161,7 @@ public function testInflectingPlurals() {
$this->assertEquals(Inflector::pluralize('cafe'), 'cafes');
$this->assertEquals(Inflector::pluralize('roof'), 'roofs');
$this->assertEquals(Inflector::pluralize('foe'), 'foes');
$this->assertEquals(Inflector::pluralize('cookie'), 'cookie');
$this->assertEquals(Inflector::pluralize(''), '');
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/Utility/Inflector.php
Expand Up @@ -55,14 +55,15 @@ class Inflector {
'/$/' => 's',
),
'uninflected' => array(
'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people'
'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people', 'cookie'
),
'irregular' => array(
'atlas' => 'atlases',
'beef' => 'beefs',
'brother' => 'brothers',
'cafe' => 'cafes',
'child' => 'children',
'cookie' => 'cookies',
'corpus' => 'corpuses',
'cow' => 'cows',
'ganglion' => 'ganglions',
Expand Down

0 comments on commit 9dc3b24

Please sign in to comment.