mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
6593be8239
commit
789f1f4f3d
2 changed files with 10 additions and 1 deletions
|
@ -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',
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue