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
This commit is contained in:
nate 2008-05-06 20:44:47 +00:00
parent 7985746190
commit 4519261b39

View file

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