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:
nate 2007-02-07 00:01:04 +00:00
parent 5c2e4821f7
commit 194e9e09b1

View file

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