Browse Source

Merge branch '1.3-inflector' into 1.3

gwoo 16 years ago
parent
commit
c7050c9879
3 changed files with 5 additions and 4 deletions
  1. 3 3
      app/config/bootstrap.php
  2. 1 1
      cake/libs/inflector.php
  3. 1 0
      cake/tests/cases/libs/inflector.test.php

+ 3 - 3
app/config/bootstrap.php

@@ -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()));
  *
  */
-?>
+?>

+ 1 - 1
cake/libs/inflector.php

@@ -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',

+ 1 - 0
cake/tests/cases/libs/inflector.test.php

@@ -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');