Skip to content
Permalink
Browse files

Adding prompts for PluginTask with no args.

Test cases added.
  • Loading branch information...
markstory committed Jul 20, 2009
1 parent 2ab3986 commit de51d880fbac09d3387fcea5fb4e008c2e4e387c
Showing with 25 additions and 2 deletions.
  1. +2 −0 cake/console/libs/tasks/plugin.php
  2. +23 −2 cake/tests/cases/console/libs/tasks/plugin.test.php
@@ -75,6 +75,8 @@ function execute() {
} else {
$this->__interactive($plugin);
}
} else {
return $this->__interactive();
}
if (isset($this->args[0])) {
@@ -184,12 +184,33 @@ function testBakeFoldersAndFiles() {
$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 @@ function XXtestExecuteWithOneArg() {
*
* @return void
**/
function XXtestExecuteWithTwoArgs() {
function testExecuteWithTwoArgs() {
$this->Task->Model =& new PluginTestMockModelTask();
$this->Task->setReturnValueAt(0, 'in', $this->_testPath);
$this->Task->setReturnValueAt(1, 'in', 'y');

0 comments on commit de51d88

Please sign in to comment.
You can’t perform that action at this time.