mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Adding prompts for PluginTask with no args.
Test cases added.
This commit is contained in:
parent
2ab3986d14
commit
de51d880fb
2 changed files with 25 additions and 2 deletions
|
@ -75,6 +75,8 @@ class PluginTask extends Shell {
|
||||||
} else {
|
} else {
|
||||||
$this->__interactive($plugin);
|
$this->__interactive($plugin);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return $this->__interactive();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->args[0])) {
|
if (isset($this->args[0])) {
|
||||||
|
|
|
@ -184,12 +184,33 @@ class PluginTaskTest extends CakeTestCase {
|
||||||
$Folder =& new Folder($this->Task->path . 'bake_test_plugin');
|
$Folder =& new Folder($this->Task->path . 'bake_test_plugin');
|
||||||
$Folder->delete();
|
$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
|
* Test Execute
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
**/
|
||||||
function XXtestExecuteWithOneArg() {
|
function testExecuteWithOneArg() {
|
||||||
$this->Task->setReturnValueAt(0, 'in', $this->_testPath);
|
$this->Task->setReturnValueAt(0, 'in', $this->_testPath);
|
||||||
$this->Task->setReturnValueAt(1, 'in', 'y');
|
$this->Task->setReturnValueAt(1, 'in', 'y');
|
||||||
$this->Task->Dispatch->args = array('BakeTestPlugin');
|
$this->Task->Dispatch->args = array('BakeTestPlugin');
|
||||||
|
@ -212,7 +233,7 @@ class PluginTaskTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
**/
|
||||||
function XXtestExecuteWithTwoArgs() {
|
function testExecuteWithTwoArgs() {
|
||||||
$this->Task->Model =& new PluginTestMockModelTask();
|
$this->Task->Model =& new PluginTestMockModelTask();
|
||||||
$this->Task->setReturnValueAt(0, 'in', $this->_testPath);
|
$this->Task->setReturnValueAt(0, 'in', $this->_testPath);
|
||||||
$this->Task->setReturnValueAt(1, 'in', 'y');
|
$this->Task->setReturnValueAt(1, 'in', 'y');
|
||||||
|
|
Loading…
Add table
Reference in a new issue