Skip to content

Commit

Permalink
Updating shells and shell tests for changes in __construct.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 24, 2010
1 parent ba17e2c commit 5edb277
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 28 deletions.
6 changes: 3 additions & 3 deletions cake/console/shells/command_list.php
Expand Up @@ -44,9 +44,9 @@ public function startup() {
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);
Expand Down
6 changes: 1 addition & 5 deletions cake/tests/cases/console/shells/api.test.php
Expand Up @@ -41,14 +41,10 @@ public function setUp() {
$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)
);
}

Expand Down
6 changes: 1 addition & 5 deletions cake/tests/cases/console/shells/bake.test.php
Expand Up @@ -53,14 +53,10 @@ public function setUp() {
$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)
);
}

Expand Down
10 changes: 3 additions & 7 deletions cake/tests/cases/console/shells/command_list.test.php
Expand Up @@ -50,17 +50,13 @@ public function setUp() {
), 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)
);
}

Expand All @@ -71,7 +67,7 @@ public function setUp() {
*/
function tearDown() {
parent::tearDown();
unset($this->Dispatcher, $this->Shell);
unset($this->Shell);
}

/**
Expand All @@ -82,7 +78,7 @@ function tearDown() {
function testMain() {
$this->Shell->main();
$output = $this->Shell->stdout->output;
;

$expected = "/example \[.*TestPlugin, TestPluginTwo.*\]/";
$this->assertPattern($expected, $output);

Expand Down
5 changes: 2 additions & 3 deletions cake/tests/cases/console/shells/schema.test.php
Expand Up @@ -114,11 +114,10 @@ public function setUp() {

$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)
);
}

Expand Down Expand Up @@ -476,7 +475,7 @@ public function testPluginDotSyntaxWithCreate() {

$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'));
Expand Down
9 changes: 4 additions & 5 deletions cake/tests/cases/console/shells/testsuite.test.php
Expand Up @@ -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)
);
}

Expand Down

0 comments on commit 5edb277

Please sign in to comment.