Skip to content
Permalink
Browse files

Updating shells and shell tests for changes in __construct.

  • Loading branch information...
markstory committed Oct 24, 2010
1 parent ba17e2c commit 5edb277111e3e6f8746bd051d19054e920fed99a
@@ -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);
@@ -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)
);
}
@@ -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)
);
}
@@ -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)
);
}
@@ -71,7 +67,7 @@ public function setUp() {
*/
function tearDown() {
parent::tearDown();
unset($this->Dispatcher, $this->Shell);
unset($this->Shell);
}
/**
@@ -82,7 +78,7 @@ function tearDown() {
function testMain() {
$this->Shell->main();
$output = $this->Shell->stdout->output;
;
$expected = "/example \[.*TestPlugin, TestPluginTwo.*\]/";
$this->assertPattern($expected, $output);
@@ -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)
);
}
@@ -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'));
@@ -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)
);
}

0 comments on commit 5edb277

Please sign in to comment.
You can’t perform that action at this time.