mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 10:36:16 +00:00
Restructuring Inflector tests, and adding test for Ticket #2068
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4464 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5c2e4821f7
commit
194e9e09b1
1 changed files with 17 additions and 3 deletions
|
@ -40,7 +40,17 @@ class InflectorTest extends UnitTestCase {
|
|||
$this->inflector = new Inflector();
|
||||
}
|
||||
|
||||
function testInflectingStuff() {
|
||||
function testInflectingSingulars() {
|
||||
$result = $this->inflector->singularize('menus');
|
||||
$expected = 'menu';
|
||||
$this->assertEqual($result, $expected, "Badness! Expected '{$expected}', got '{$result}'");
|
||||
|
||||
$result = $this->inflector->singularize('quizzes');
|
||||
$expected = 'quiz';
|
||||
$this->assertEqual($result, $expected, "Badness! Expected '{$expected}', got '{$result}'");
|
||||
}
|
||||
|
||||
function testInflectingPlurals() {
|
||||
$result = $this->inflector->pluralize('Bus');
|
||||
$expected = 'Buses';
|
||||
$this->assertEqual($result, $expected, "Badness! Expected '{$expected}', got '{$result}'");
|
||||
|
@ -49,8 +59,12 @@ class InflectorTest extends UnitTestCase {
|
|||
$expected = 'buses';
|
||||
$this->assertEqual($this->inflector->pluralize('bus'), 'buses', "Badness! Expected '{$expected}', got '{$result}'");
|
||||
|
||||
$result = $this->inflector->singularize('menus');
|
||||
$expected = 'menu';
|
||||
$result = $this->inflector->pluralize('menu');
|
||||
$expected = 'menus';
|
||||
$this->assertEqual($result, $expected, "Badness! Expected '{$expected}', got '{$result}'");
|
||||
|
||||
$result = $this->inflector->pluralize('quiz');
|
||||
$expected = 'quizzes';
|
||||
$this->assertEqual($result, $expected, "Badness! Expected '{$expected}', got '{$result}'");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue