Permalink
Browse files

Adding tests so no empty helpers/components

can be added. Refs #6383
  • Loading branch information...
markstory committed Jun 7, 2009
1 parent 5e5293a commit d810b43e80376d7e8a80adb68e07446a00e5970e
Showing with 13 additions and 1 deletion.
  1. +1 −1 cake/console/libs/tasks/controller.php
  2. +12 −0 cake/tests/cases/console/libs/tasks/controller.test.php
@@ -373,7 +373,7 @@ function _doPropertyChoices($prompt, $example) {
$propertyListTrimmed = str_replace(' ', '', $propertyList);
$property = explode(',', $propertyListTrimmed);
}
- return $property;
+ return array_filter($property);
}
/**
@@ -181,6 +181,12 @@ function testDoHelpers() {
$result = $this->Task->doHelpers();
$expected = array('Javascript', 'Ajax', 'CustomOne');
$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 @@ function testDoComponents() {
$result = $this->Task->doComponents();
$expected = array('RequestHandler', 'Security');
$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);
}
/**

0 comments on commit d810b43

Please sign in to comment.