Skip to content
This repository
Browse code

Fix singularization of databases.

Fixes #2822
  • Loading branch information...
commit 13468937cce7869990d017eadfecf6e5a859cc99 1 parent 3627512
Mark Story authored April 23, 2012
1  lib/Cake/Test/Case/Utility/InflectorTest.php
@@ -108,6 +108,7 @@ public function testInflectingSingulars() {
108 108
 		$this->assertEquals(Inflector::singularize('cafes'), 'cafe');
109 109
 		$this->assertEquals(Inflector::singularize('roofs'), 'roof');
110 110
 		$this->assertEquals(Inflector::singularize('foes'), 'foe');
  111
+		$this->assertEquals(Inflector::singularize('databases'), 'database');
111 112
 
112 113
 		$this->assertEquals(Inflector::singularize(''), '');
113 114
 	}
2  lib/Cake/Utility/Inflector.php
@@ -124,7 +124,7 @@ class Inflector {
124 124
 			'/(drive)s$/i' => '\1',
125 125
 			'/([^fo])ves$/i' => '\1fe',
126 126
 			'/(^analy)ses$/i' => '\1sis',
127  
-			'/(analy|ba|diagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
  127
+			'/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
128 128
 			'/([ti])a$/i' => '\1um',
129 129
 			'/(p)eople$/i' => '\1\2erson',
130 130
 			'/(m)en$/i' => '\1an',

0 notes on commit 1346893

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