Updating test cases to use new Shell internals.

Cleaning up some mocks.
This commit is contained in:
mark_story 2010-10-05 23:51:08 -04:00
parent 7921ef1282
commit a3023430c8
5 changed files with 11 additions and 10 deletions

View file

@ -51,7 +51,7 @@ class AclShellTest extends CakeTestCase {
$this->Dispatcher = $this->getMock( $this->Dispatcher = $this->getMock(
'ShellDispatcher', 'ShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'dispatch', 'clear') array('_stop', '_initEnvironment', 'dispatch')
); );
$this->Task = $this->getMock( $this->Task = $this->getMock(
'AclShell', 'AclShell',

View file

@ -40,7 +40,7 @@ class ApiShellTest extends CakeTestCase {
parent::setUp(); parent::setUp();
$this->Dispatcher = $this->getMock( $this->Dispatcher = $this->getMock(
'ShellDispatcher', 'ShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'dispatch', 'clear') array('_stop', '_initEnvironment', 'dispatch')
); );
$this->Shell = $this->getMock( $this->Shell = $this->getMock(
'ApiShell', 'ApiShell',

View file

@ -52,7 +52,7 @@ class BakeShellTest extends CakeTestCase {
parent::setUp(); parent::setUp();
$this->Dispatcher = $this->getMock( $this->Dispatcher = $this->getMock(
'ShellDispatcher', 'ShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'clear') array('_stop', '_initEnvironment')
); );
$this->Shell = $this->getMock( $this->Shell = $this->getMock(
'BakeShell', 'BakeShell',

View file

@ -50,14 +50,15 @@ class CommandListTest extends CakeTestCase {
$this->Dispatcher = $this->getMock( $this->Dispatcher = $this->getMock(
'ShellDispatcher', '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( $this->Shell = $this->getMock(
'CommandListShell', 'CommandListShell',
array('in', '_stop'), array('in', '_stop', 'clear'),
array(&$this->Dispatcher) array(&$this->Dispatcher, $out, null, $in)
); );
} }
@ -77,7 +78,7 @@ class CommandListTest extends CakeTestCase {
*/ */
function testMain() { function testMain() {
$this->Shell->main(); $this->Shell->main();
$output = $this->Dispatcher->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

@ -34,11 +34,11 @@ class TestSuiteShellTest extends CakeTestCase {
public function setUp() { public function setUp() {
$this->Dispatcher = $this->getMock( $this->Dispatcher = $this->getMock(
'ShellDispatcher', 'ShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'clear') array('_stop', '_initEnvironment')
); );
$this->Shell = $this->getMock( $this->Shell = $this->getMock(
'TestSuiteShell', '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) array(&$this->Dispatcher)
); );
$this->Shell->Dispatch->shellPaths = App::path('shells'); $this->Shell->Dispatch->shellPaths = App::path('shells');