Adding prompts for PluginTask with no args.

Test cases added.
This commit is contained in:
mark_story 2009-07-20 00:20:58 -04:00
parent 2ab3986d14
commit de51d880fb
2 changed files with 25 additions and 2 deletions

View file

@ -75,6 +75,8 @@ class PluginTask extends Shell {
} else {
$this->__interactive($plugin);
}
} else {
return $this->__interactive();
}
if (isset($this->args[0])) {

View file

@ -184,12 +184,33 @@ class PluginTaskTest extends CakeTestCase {
$Folder =& new Folder($this->Task->path . 'bake_test_plugin');
$Folder->delete();
}
/**
* test execute with no args, flowing into interactive,
*
* @return void
**/
function testExecuteWithNoArgs() {
$this->Task->setReturnValueAt(0, 'in', 'TestPlugin');
$this->Task->setReturnValueAt(1, 'in', '2');
$this->Task->setReturnValueAt(2, 'in', 'y');
$this->Task->setReturnValueAt(3, 'in', 'n');
$path = $this->Task->path . 'test_plugin';
$file = $path . DS . 'test_plugin_app_controller.php';
$this->Task->expectAt(0, 'createFile', array($file, '*'), 'No AppController %s');
$file = $path . DS . 'test_plugin_app_model.php';
$this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s');
$this->Task->args = array();
$this->Task->execute();
}
/**
* Test Execute
*
* @return void
**/
function XXtestExecuteWithOneArg() {
function testExecuteWithOneArg() {
$this->Task->setReturnValueAt(0, 'in', $this->_testPath);
$this->Task->setReturnValueAt(1, 'in', 'y');
$this->Task->Dispatch->args = array('BakeTestPlugin');
@ -212,7 +233,7 @@ class PluginTaskTest extends CakeTestCase {
*
* @return void
**/
function XXtestExecuteWithTwoArgs() {
function testExecuteWithTwoArgs() {
$this->Task->Model =& new PluginTestMockModelTask();
$this->Task->setReturnValueAt(0, 'in', $this->_testPath);
$this->Task->setReturnValueAt(1, 'in', 'y');