Updating shells and shell tests for changes in __construct.

This commit is contained in:
mark_story 2010-10-24 15:11:30 -04:00
parent ba17e2c9a0
commit 5edb277111
6 changed files with 14 additions and 28 deletions

View file

@ -44,9 +44,9 @@ class CommandListShell extends Shell {
public function main() { public function main() {
if (empty($this->params['xml'])) { if (empty($this->params['xml'])) {
$this->out("<info>Current Paths:</info>", 2); $this->out("<info>Current Paths:</info>", 2);
$this->out(" -app: ". $this->Dispatch->params['app']); $this->out(" -app: ". APP_DIR);
$this->out(" -working: " . rtrim($this->Dispatch->params['working'], DS)); $this->out(" -working: " . rtrim(APP_PATH, DS));
$this->out(" -root: " . rtrim($this->Dispatch->params['root'], DS)); $this->out(" -root: " . rtrim(ROOT, DS));
$this->out(" -core: " . rtrim(CORE_PATH, DS)); $this->out(" -core: " . rtrim(CORE_PATH, DS));
$this->out(""); $this->out("");
$this->out("<info>Changing Paths:</info>", 2); $this->out("<info>Changing Paths:</info>", 2);

View file

@ -41,14 +41,10 @@ class ApiShellTest extends CakeTestCase {
$out = $this->getMock('ConsoleOutput', array(), array(), '', false); $out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false); $in = $this->getMock('ConsoleInput', array(), array(), '', false);
$this->Dispatcher = $this->getMock(
'ShellDispatcher',
array('_stop', '_initEnvironment', 'dispatch')
);
$this->Shell = $this->getMock( $this->Shell = $this->getMock(
'ApiShell', 'ApiShell',
array('in', 'out', 'createFile', 'hr', '_stop'), array('in', 'out', 'createFile', 'hr', '_stop'),
array(&$this->Dispatcher, $out, $out, $in) array( $out, $out, $in)
); );
} }

View file

@ -53,14 +53,10 @@ class BakeShellTest extends CakeTestCase {
$out = $this->getMock('ConsoleOutput', array(), array(), '', false); $out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false); $in = $this->getMock('ConsoleInput', array(), array(), '', false);
$this->Dispatcher = $this->getMock(
'ShellDispatcher',
array('_stop', '_initEnvironment')
);
$this->Shell = $this->getMock( $this->Shell = $this->getMock(
'BakeShell', 'BakeShell',
array('in', 'out', 'hr', 'err', 'createFile', '_stop', '_checkUnitTest'), array('in', 'out', 'hr', 'err', 'createFile', '_stop', '_checkUnitTest'),
array(&$this->Dispatcher, $out, $out, $in) array($out, $out, $in)
); );
} }

View file

@ -50,17 +50,13 @@ class CommandListTest extends CakeTestCase {
), true); ), true);
App::objects('plugin', null, false); App::objects('plugin', null, false);
$this->Dispatcher = $this->getMock(
'ShellDispatcher',
array('_stop', '_initEnvironment', 'dispatch')
);
$out = new TestStringOutput(); $out = new TestStringOutput();
$in = $this->getMock('ConsoleInput', array(), array(), '', false); $in = $this->getMock('ConsoleInput', array(), array(), '', false);
$this->Shell = $this->getMock( $this->Shell = $this->getMock(
'CommandListShell', 'CommandListShell',
array('in', '_stop', 'clear'), array('in', '_stop', 'clear'),
array(&$this->Dispatcher, $out, $out, $in) array($out, $out, $in)
); );
} }
@ -71,7 +67,7 @@ class CommandListTest extends CakeTestCase {
*/ */
function tearDown() { function tearDown() {
parent::tearDown(); parent::tearDown();
unset($this->Dispatcher, $this->Shell); unset($this->Shell);
} }
/** /**
@ -82,7 +78,7 @@ class CommandListTest extends CakeTestCase {
function testMain() { function testMain() {
$this->Shell->main(); $this->Shell->main();
$output = $this->Shell->stdout->output; $output = $this->Shell->stdout->output;
;
$expected = "/example \[.*TestPlugin, TestPluginTwo.*\]/"; $expected = "/example \[.*TestPlugin, TestPluginTwo.*\]/";
$this->assertPattern($expected, $output); $this->assertPattern($expected, $output);

View file

@ -114,11 +114,10 @@ class SchemaShellTest extends CakeTestCase {
$out = $this->getMock('ConsoleOutput', array(), array(), '', false); $out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false); $in = $this->getMock('ConsoleInput', array(), array(), '', false);
$this->Dispatcher = $this->getMock('ShellDispatcher', array('_stop', '_initEnvironment'));
$this->Shell = $this->getMock( $this->Shell = $this->getMock(
'SchemaShell', 'SchemaShell',
array('in', 'out', 'hr', 'createFile', 'error', 'err', '_stop'), 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'); $db =& ConnectionManager::getDataSource('test');
$sources = $db->listSources(); $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(); $schema = new TestPluginAppSchema();
$db->execute($db->dropSchema($schema, 'test_plugin_acos')); $db->execute($db->dropSchema($schema, 'test_plugin_acos'));

View file

@ -33,14 +33,13 @@ class TestSuiteShellTest extends CakeTestCase {
* @return void * @return void
*/ */
public function setUp() { public function setUp() {
$this->Dispatcher = $this->getMock( $out = $this->getMock('ConsoleOutput', array(), array(), '', false);
'ShellDispatcher', $in = $this->getMock('ConsoleInput', array(), array(), '', false);
array('_stop', '_initEnvironment')
);
$this->Shell = $this->getMock( $this->Shell = $this->getMock(
'TestSuiteShell', 'TestSuiteShell',
array('in', 'out', 'hr', 'help', 'error', 'err', '_stop', 'initialize', 'run', 'clear'), array('in', 'out', 'hr', 'help', 'error', 'err', '_stop', 'initialize', 'run', 'clear'),
array(&$this->Dispatcher) array($out, $out, $in)
); );
} }