Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix inflection rules for curves.

Remove curve from the uninflected list and update rules so it, wolves,
and lives are still properly handled.

Fixes #2148
  • Loading branch information...
commit 1ae470a2841f803e0ee7e9dfa03a8f3132edfaf0 1 parent 935a51c
@markstory markstory authored
View
2  lib/Cake/Test/Case/Utility/InflectorTest.php
@@ -122,6 +122,7 @@ public function testInflectingSingulars() {
$this->assertEquals(Inflector::singularize('briefs'), 'brief');
$this->assertEquals(Inflector::singularize('quotas'), 'quota');
$this->assertEquals(Inflector::singularize('curves'), 'curve');
+ $this->assertEquals(Inflector::singularize('body_curves'), 'body_curve');
$this->assertEquals(Inflector::singularize(''), '');
}
@@ -185,6 +186,7 @@ public function testInflectingPlurals() {
$this->assertEquals(Inflector::pluralize('brief'), 'briefs');
$this->assertEquals(Inflector::pluralize('quota'), 'quotas');
$this->assertEquals(Inflector::pluralize('curve'), 'curves');
+ $this->assertEquals(Inflector::pluralize('body_curve'), 'body_curves');
$this->assertEquals(Inflector::pluralize(''), '');
}
View
5 lib/Cake/Utility/Inflector.php
@@ -129,8 +129,8 @@ class Inflector {
'/(tive)s$/i' => '\1',
'/(hive)s$/i' => '\1',
'/(drive)s$/i' => '\1',
- '/([lre])ves$/i' => '\1f',
- '/([^fo])ves$/i' => '\1fe',
+ '/([le])ves$/i' => '\1f',
+ '/([^rfo])ves$/i' => '\1fe',
'/(^analy)ses$/i' => '\1sis',
'/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
'/([ti])a$/i' => '\1um',
@@ -148,7 +148,6 @@ class Inflector {
'irregular' => array(
'foes' => 'foe',
'waves' => 'wave',
- 'curves' => 'curve'
)
);
Please sign in to comment.
Something went wrong with that request. Please try again.