Adding tests so no empty helpers/components

can be added. Refs #6383
This commit is contained in:
mark_story 2009-06-07 12:22:43 -04:00
parent 5e5293a866
commit d810b43e80
2 changed files with 13 additions and 1 deletions

View file

@ -373,7 +373,7 @@ class ControllerTask extends Shell {
$propertyListTrimmed = str_replace(' ', '', $propertyList); $propertyListTrimmed = str_replace(' ', '', $propertyList);
$property = explode(',', $propertyListTrimmed); $property = explode(',', $propertyListTrimmed);
} }
return $property; return array_filter($property);
} }
/** /**

View file

@ -181,6 +181,12 @@ class ControllerTaskTest extends CakeTestCase {
$result = $this->Task->doHelpers(); $result = $this->Task->doHelpers();
$expected = array('Javascript', 'Ajax', 'CustomOne'); $expected = array('Javascript', 'Ajax', 'CustomOne');
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$this->Task->setReturnValueAt(3, 'in', 'y');
$this->Task->setReturnValueAt(4, 'in', ' Javascript, Ajax, CustomOne, , ');
$result = $this->Task->doHelpers();
$expected = array('Javascript', 'Ajax', 'CustomOne');
$this->assertEqual($result, $expected);
} }
/** /**
@ -198,6 +204,12 @@ class ControllerTaskTest extends CakeTestCase {
$result = $this->Task->doComponents(); $result = $this->Task->doComponents();
$expected = array('RequestHandler', 'Security'); $expected = array('RequestHandler', 'Security');
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$this->Task->setReturnValueAt(3, 'in', 'y');
$this->Task->setReturnValueAt(4, 'in', ' RequestHandler, Security, , ');
$result = $this->Task->doComponents();
$expected = array('RequestHandler', 'Security');
$this->assertEqual($result, $expected);
} }
/** /**