From 194e9e09b1e09e950cdec4d44293dcd9f9bb0edb Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 7 Feb 2007 00:01:04 +0000 Subject: [PATCH] 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 --- cake/tests/cases/libs/inflector.test.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 8143938fd..fe631a62a 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -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}'"); }