Merge branch '1.3-inflector' into 1.3

This commit is contained in:
gwoo 2009-08-01 23:53:36 -07:00
commit c7050c9879
3 changed files with 5 additions and 4 deletions

View file

@ -44,8 +44,8 @@
/**
* As of 1.3, additional rules for the inflector are added below
*
* Inflector::rule('singular', array('rules' => array(), irregular' => array(), 'uninflected' => array()));
* Inflector::rule('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
?>
?>

View file

@ -126,7 +126,7 @@ class Inflector extends Object {
'/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us',
'/([ftw]ax)es/' => '\1',
'/(cris|ax|test)es$/i' => '\1is',
'/(shoe)s$/i' => '\1',
'/(shoe|slave)s$/i' => '\1',
'/(o)es$/i' => '\1',
'/ouses$/' => 'ouse',
'/uses$/' => 'us',

View file

@ -105,6 +105,7 @@ class InflectorTest extends CakeTestCase {
$this->assertEqual(Inflector::singularize('lives'), 'life');
$this->assertEqual(Inflector::singularize('knives'), 'knife');
$this->assertEqual(Inflector::singularize('wolves'), 'wolf');
$this->assertEqual(Inflector::singularize('slaves'), 'slave');
$this->assertEqual(Inflector::singularize('shelves'), 'shelf');
$this->assertEqual(Inflector::singularize('taxis'), 'taxi');
$this->assertEqual(Inflector::singularize('taxes'), 'tax');