From 4519261b39166301cd773a1a2dbb0880b6a02c35 Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 6 May 2008 20:44:47 +0000 Subject: [PATCH] Adding test cases for TextHelper::toList() git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6765 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/view/helpers/text.test.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/cake/tests/cases/libs/view/helpers/text.test.php index 10a124a79..5f26fbac5 100644 --- a/cake/tests/cases/libs/view/helpers/text.test.php +++ b/cake/tests/cases/libs/view/helpers/text.test.php @@ -26,7 +26,9 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -uses('view'.DS.'helpers'.DS.'app_helper', 'view'.DS.'helper', 'view'.DS.'helpers'.DS.'text'); +App::import('Core', array('Helper', 'AppHelper')); +App::import('Helper', 'Text'); + /** * Short description for class. * @@ -178,6 +180,14 @@ class TextTest extends UnitTestCase { $this->assertEqual($expected, $result); } + function testListGeneration() { + $result = $this->Text->toList(array('Larry', 'Curly', 'Moe')); + $this->assertEqual($result, 'Larry, Curly and Moe'); + + $result = $this->Text->toList(array('Dusty', 'Lucky', 'Ned'), 'y'); + $this->assertEqual($result, 'Dusty, Lucky y Ned'); + } + function tearDown() { unset($this->Text); }