Skip to content
Browse files

Adding cafe to the list of irregular plurals. Seems that its

french origins befuddle normal english pluralization rules.
Fixes #1930
  • Loading branch information...
1 parent 27ab909 commit 5b43d6b9a7534f7bc3280fdb3ee9b1c6f826ea2a @markstory markstory committed Aug 28, 2011
Showing with 5 additions and 0 deletions.
  1. +1 −0 cake/libs/inflector.php
  2. +4 −0 cake/tests/cases/libs/inflector.test.php
View
1 cake/libs/inflector.php
@@ -70,6 +70,7 @@ class Inflector {
'atlas' => 'atlases',
'beef' => 'beefs',
'brother' => 'brothers',
+ 'cafe' => 'cafes',
'child' => 'children',
'corpus' => 'corpuses',
'cow' => 'cows',
View
4 cake/tests/cases/libs/inflector.test.php
@@ -116,6 +116,8 @@ function testInflectingSingulars() {
$this->assertEqual(Inflector::singularize('bases'), 'basis');
$this->assertEqual(Inflector::singularize('analyses'), 'analysis');
$this->assertEqual(Inflector::singularize('curves'), 'curve');
+ $this->assertEqual(Inflector::singularize('cafes'), 'cafe');
+ $this->assertEqual(Inflector::singularize('roofs'), 'roof');
$this->assertEqual(Inflector::singularize(''), '');
}
@@ -164,6 +166,8 @@ function testInflectingPlurals() {
$this->assertEqual(Inflector::pluralize('tax'), 'taxes');
$this->assertEqual(Inflector::pluralize('wave'), 'waves');
$this->assertEqual(Inflector::pluralize('bureau'), 'bureaus');
+ $this->assertEqual(Inflector::pluralize('cafe'), 'cafes');
+ $this->assertEqual(Inflector::pluralize('roof'), 'roofs');
$this->assertEqual(Inflector::pluralize(''), '');
}

0 comments on commit 5b43d6b

Please sign in to comment.
Something went wrong with that request. Please try again.