Skip to content
This repository
Browse code

Correct inflection rules for cookies, fixes fixes #3291

  • Loading branch information...
commit 9dc3b243ac33b19131a6ac28afabd7e945f72cda 1 parent 08556ab
José Lorenzo Rodríguez authored October 22, 2012
2  lib/Cake/Test/Case/Utility/InflectorTest.php
@@ -109,6 +109,7 @@ public function testInflectingSingulars() {
109 109
 		$this->assertEquals(Inflector::singularize('roofs'), 'roof');
110 110
 		$this->assertEquals(Inflector::singularize('foes'), 'foe');
111 111
 		$this->assertEquals(Inflector::singularize('databases'), 'database');
  112
+		$this->assertEquals(Inflector::singularize('cookies'), 'cookie');
112 113
 
113 114
 		$this->assertEquals(Inflector::singularize(''), '');
114 115
 	}
@@ -160,6 +161,7 @@ public function testInflectingPlurals() {
160 161
 		$this->assertEquals(Inflector::pluralize('cafe'), 'cafes');
161 162
 		$this->assertEquals(Inflector::pluralize('roof'), 'roofs');
162 163
 		$this->assertEquals(Inflector::pluralize('foe'), 'foes');
  164
+		$this->assertEquals(Inflector::pluralize('cookie'), 'cookie');
163 165
 		$this->assertEquals(Inflector::pluralize(''), '');
164 166
 	}
165 167
 
3  lib/Cake/Utility/Inflector.php
@@ -55,7 +55,7 @@ class Inflector {
55 55
 			'/$/' => 's',
56 56
 		),
57 57
 		'uninflected' => array(
58  
-			'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people'
  58
+			'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people', 'cookie'
59 59
 		),
60 60
 		'irregular' => array(
61 61
 			'atlas' => 'atlases',
@@ -63,6 +63,7 @@ class Inflector {
63 63
 			'brother' => 'brothers',
64 64
 			'cafe' => 'cafes',
65 65
 			'child' => 'children',
  66
+			'cookie' => 'cookies',
66 67
 			'corpus' => 'corpuses',
67 68
 			'cow' => 'cows',
68 69
 			'ganglion' => 'ganglions',

0 notes on commit 9dc3b24

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