Skip to content

Commit

Permalink
Updating test cases to use new Shell internals.
Browse files Browse the repository at this point in the history
Cleaning up some mocks.
  • Loading branch information
markstory committed Oct 14, 2010
1 parent 7921ef1 commit a302343
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/acl.test.php
Expand Up @@ -51,7 +51,7 @@ public function setUp() {

$this->Dispatcher = $this->getMock(
'ShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'dispatch', 'clear')
array('_stop', '_initEnvironment', 'dispatch')
);
$this->Task = $this->getMock(
'AclShell',
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/api.test.php
Expand Up @@ -40,7 +40,7 @@ public function setUp() {
parent::setUp();
$this->Dispatcher = $this->getMock(
'ShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'dispatch', 'clear')
array('_stop', '_initEnvironment', 'dispatch')
);
$this->Shell = $this->getMock(
'ApiShell',
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/bake.test.php
Expand Up @@ -52,7 +52,7 @@ public function setUp() {
parent::setUp();
$this->Dispatcher = $this->getMock(
'ShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'clear')
array('_stop', '_initEnvironment')
);
$this->Shell = $this->getMock(
'BakeShell',
Expand Down
11 changes: 6 additions & 5 deletions cake/tests/cases/console/libs/command_list.test.php
Expand Up @@ -50,14 +50,15 @@ public function setUp() {

$this->Dispatcher = $this->getMock(
'ShellDispatcher',
array('getInput', 'stderr', '_stop', '_initEnvironment', 'dispatch', 'clear')
array('_stop', '_initEnvironment', 'dispatch')
);
$this->Dispatcher->stdout = new TestStringOutput();
$out = new TestStringOutput();
$in = $this->getMock('ConsoleInput');

$this->Shell = $this->getMock(
'CommandListShell',
array('in', '_stop'),
array(&$this->Dispatcher)
array('in', '_stop', 'clear'),
array(&$this->Dispatcher, $out, null, $in)
);
}

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

$expected = "/example \[.*TestPlugin, TestPluginTwo.*\]/";
$this->assertPattern($expected, $output);
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/cases/console/libs/testsuite.test.php
Expand Up @@ -34,11 +34,11 @@ class TestSuiteShellTest extends CakeTestCase {
public function setUp() {
$this->Dispatcher = $this->getMock(
'ShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'clear')
array('_stop', '_initEnvironment')
);
$this->Shell = $this->getMock(
'TestSuiteShell',
array('in', 'out', 'hr', 'help', 'error', 'err', '_stop', 'initialize', 'run'),
array('in', 'out', 'hr', 'help', 'error', 'err', '_stop', 'initialize', 'run', 'clear'),
array(&$this->Dispatcher)
);
$this->Shell->Dispatch->shellPaths = App::path('shells');
Expand Down

0 comments on commit a302343

Please sign in to comment.