Skip to content

Commit

Permalink
Fix singularization of databases.
Browse files Browse the repository at this point in the history
Fixes #2822
  • Loading branch information
markstory committed Apr 24, 2012
1 parent 593e63b commit a0c9299
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/inflector.php
Expand Up @@ -134,7 +134,7 @@ class Inflector {
'/(drive)s$/i' => '\1',
'/([^fo])ves$/i' => '\1fe',
'/(^analy)ses$/i' => '\1sis',
'/(analy|ba|diagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
'/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
'/([ti])a$/i' => '\1um',
'/(p)eople$/i' => '\1\2erson',
'/(m)en$/i' => '\1an',
Expand Down
2 changes: 2 additions & 0 deletions cake/tests/cases/libs/inflector.test.php
Expand Up @@ -120,6 +120,7 @@ function testInflectingSingulars() {
$this->assertEqual(Inflector::singularize('cafes'), 'cafe');
$this->assertEqual(Inflector::singularize('roofs'), 'roof');
$this->assertEqual(Inflector::singularize('foes'), 'foe');
$this->assertEqual(Inflector::singularize('databases'), 'database');

$this->assertEqual(Inflector::singularize(''), '');
}
Expand Down Expand Up @@ -172,6 +173,7 @@ function testInflectingPlurals() {
$this->assertEqual(Inflector::pluralize('cafe'), 'cafes');
$this->assertEqual(Inflector::pluralize('roof'), 'roofs');
$this->assertEqual(Inflector::pluralize('foe'), 'foes');
$this->assertEqual(Inflector::pluralize('database'), 'databases');
$this->assertEqual(Inflector::pluralize(''), '');
}

Expand Down

0 comments on commit a0c9299

Please sign in to comment.