mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Updating shells and shell tests for changes in __construct.
This commit is contained in:
parent
ba17e2c9a0
commit
5edb277111
6 changed files with 14 additions and 28 deletions
|
@ -44,9 +44,9 @@ class CommandListShell extends Shell {
|
|||
public function main() {
|
||||
if (empty($this->params['xml'])) {
|
||||
$this->out("<info>Current Paths:</info>", 2);
|
||||
$this->out(" -app: ". $this->Dispatch->params['app']);
|
||||
$this->out(" -working: " . rtrim($this->Dispatch->params['working'], DS));
|
||||
$this->out(" -root: " . rtrim($this->Dispatch->params['root'], DS));
|
||||
$this->out(" -app: ". APP_DIR);
|
||||
$this->out(" -working: " . rtrim(APP_PATH, DS));
|
||||
$this->out(" -root: " . rtrim(ROOT, DS));
|
||||
$this->out(" -core: " . rtrim(CORE_PATH, DS));
|
||||
$this->out("");
|
||||
$this->out("<info>Changing Paths:</info>", 2);
|
||||
|
|
|
@ -41,14 +41,10 @@ class ApiShellTest extends CakeTestCase {
|
|||
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
||||
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
||||
|
||||
$this->Dispatcher = $this->getMock(
|
||||
'ShellDispatcher',
|
||||
array('_stop', '_initEnvironment', 'dispatch')
|
||||
);
|
||||
$this->Shell = $this->getMock(
|
||||
'ApiShell',
|
||||
array('in', 'out', 'createFile', 'hr', '_stop'),
|
||||
array(&$this->Dispatcher, $out, $out, $in)
|
||||
array( $out, $out, $in)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,14 +53,10 @@ class BakeShellTest extends CakeTestCase {
|
|||
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
||||
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
||||
|
||||
$this->Dispatcher = $this->getMock(
|
||||
'ShellDispatcher',
|
||||
array('_stop', '_initEnvironment')
|
||||
);
|
||||
$this->Shell = $this->getMock(
|
||||
'BakeShell',
|
||||
array('in', 'out', 'hr', 'err', 'createFile', '_stop', '_checkUnitTest'),
|
||||
array(&$this->Dispatcher, $out, $out, $in)
|
||||
array($out, $out, $in)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,17 +50,13 @@ class CommandListTest extends CakeTestCase {
|
|||
), true);
|
||||
App::objects('plugin', null, false);
|
||||
|
||||
$this->Dispatcher = $this->getMock(
|
||||
'ShellDispatcher',
|
||||
array('_stop', '_initEnvironment', 'dispatch')
|
||||
);
|
||||
$out = new TestStringOutput();
|
||||
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
||||
|
||||
$this->Shell = $this->getMock(
|
||||
'CommandListShell',
|
||||
array('in', '_stop', 'clear'),
|
||||
array(&$this->Dispatcher, $out, $out, $in)
|
||||
array($out, $out, $in)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -71,7 +67,7 @@ class CommandListTest extends CakeTestCase {
|
|||
*/
|
||||
function tearDown() {
|
||||
parent::tearDown();
|
||||
unset($this->Dispatcher, $this->Shell);
|
||||
unset($this->Shell);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -82,7 +78,7 @@ class CommandListTest extends CakeTestCase {
|
|||
function testMain() {
|
||||
$this->Shell->main();
|
||||
$output = $this->Shell->stdout->output;
|
||||
;
|
||||
|
||||
$expected = "/example \[.*TestPlugin, TestPluginTwo.*\]/";
|
||||
$this->assertPattern($expected, $output);
|
||||
|
||||
|
|
|
@ -114,11 +114,10 @@ class SchemaShellTest extends CakeTestCase {
|
|||
|
||||
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
||||
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
||||
$this->Dispatcher = $this->getMock('ShellDispatcher', array('_stop', '_initEnvironment'));
|
||||
$this->Shell = $this->getMock(
|
||||
'SchemaShell',
|
||||
array('in', 'out', 'hr', 'createFile', 'error', 'err', '_stop'),
|
||||
array(&$this->Dispatcher, $out, $out, $in)
|
||||
array($out, $out, $in)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -476,7 +475,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
|
||||
$db =& ConnectionManager::getDataSource('test');
|
||||
$sources = $db->listSources();
|
||||
$this->assertTrue(in_array($db->config['prefix'] . 'acos', $sources));
|
||||
$this->assertTrue(in_array($db->config['prefix'] . 'test_plugin_acos', $sources));
|
||||
|
||||
$schema = new TestPluginAppSchema();
|
||||
$db->execute($db->dropSchema($schema, 'test_plugin_acos'));
|
||||
|
|
|
@ -33,14 +33,13 @@ class TestSuiteShellTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function setUp() {
|
||||
$this->Dispatcher = $this->getMock(
|
||||
'ShellDispatcher',
|
||||
array('_stop', '_initEnvironment')
|
||||
);
|
||||
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
||||
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
||||
|
||||
$this->Shell = $this->getMock(
|
||||
'TestSuiteShell',
|
||||
array('in', 'out', 'hr', 'help', 'error', 'err', '_stop', 'initialize', 'run', 'clear'),
|
||||
array(&$this->Dispatcher)
|
||||
array($out, $out, $in)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue