Adding fix for Ticket #2343

Corrected test case for InflectorTest:testInflectingPlurals() house, original test used wrong method from Inflector

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4756 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-04-04 08:01:38 +00:00
parent 6593be8239
commit 789f1f4f3d
2 changed files with 10 additions and 1 deletions

View file

@ -214,6 +214,7 @@ class Inflector extends Object {
'/(cris|ax|test)es$/i' => '\1is',
'/(shoe)s$/i' => '\1',
'/(o)es$/i' => '\1',
'/ouses$/' => 'ouse',
'/uses$/' => 'us',
'/([m|l])ice$/i' => '\1ouse',
'/(x|ch|ss|sh)es$/i' => '\1',

View file

@ -49,6 +49,10 @@ class InflectorTest extends UnitTestCase {
$expected = 'house';
$this->assertEqual($result, $expected);
$result = $this->inflector->singularize('powerhouses');
$expected = 'powerhouse';
$this->assertEqual($result, $expected);
$result = $this->inflector->singularize('quizzes');
$expected = 'quiz';
$this->assertEqual($result, $expected);
@ -79,10 +83,14 @@ class InflectorTest extends UnitTestCase {
}
function testInflectingPlurals() {
$result = $this->inflector->singularize('house');
$result = $this->inflector->pluralize('house');
$expected = 'houses';
$this->assertEqual($result, $expected);
$result = $this->inflector->pluralize('powerhouse');
$expected = 'powerhouses';
$this->assertEqual($result, $expected);
$result = $this->inflector->pluralize('Bus');
$expected = 'Buses';
$this->assertEqual($result, $expected);