Fixing failing tests caused by API changes.

This commit is contained in:
mark_story 2010-10-11 01:33:24 -04:00
parent 9540f9aeff
commit 8c990a9e08
6 changed files with 10 additions and 16 deletions

View file

@ -31,9 +31,9 @@ class CommandListShell extends Shell {
*/ */
public function main() { public function main() {
$this->out("<info>Current Paths:</info>", 2); $this->out("<info>Current Paths:</info>", 2);
$this->out(" -app: ". $this->params['app']); $this->out(" -app: ". $this->Dispatch->params['app']);
$this->out(" -working: " . rtrim($this->params['working'], DS)); $this->out(" -working: " . rtrim($this->Dispatch->params['working'], DS));
$this->out(" -root: " . rtrim($this->params['root'], DS)); $this->out(" -root: " . rtrim($this->Dispatch->params['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

@ -325,7 +325,7 @@ class Shell extends Object {
} }
$this->OptionParser = $this->getOptionParser(); $this->OptionParser = $this->getOptionParser();
list($this->params, $this->args) = $this->OptionParser->parse($argv); list($this->params, $this->args) = $this->OptionParser->parse($argv, $command);
if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) { if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) {
$this->startup(); $this->startup();

View file

@ -74,9 +74,6 @@ class TestSuiteShell extends Shell {
if (isset($this->args[1])) { if (isset($this->args[1])) {
$params['case'] = Inflector::underscore($this->args[1]); $params['case'] = Inflector::underscore($this->args[1]);
} }
if (isset($this->params['filter'])) {
$this->params['-filter'] = $this->params['filter'];
}
return $params; return $params;
} }
@ -88,11 +85,9 @@ class TestSuiteShell extends Shell {
protected function runnerOptions() { protected function runnerOptions() {
$options = array(); $options = array();
foreach ($this->params as $param => $value) { foreach ($this->params as $param => $value) {
if ($param[0] === '-') { $options[] = '--' . $param;
$options[] = '-' . $param; if (is_string($value)) {
if (is_string($value)) { $options[] = $value;
$options[] = $value;
}
} }
} }
return $options; return $options;

View file

@ -58,7 +58,7 @@ class AclShellTest extends CakeTestCase {
); );
$this->Task = $this->getMock( $this->Task = $this->getMock(
'AclShell', 'AclShell',
array('in', 'out', 'hr', 'createFile', 'error', 'err'), array('in', 'out', 'hr', 'createFile', 'error', 'err', 'clear'),
array(&$this->Dispatcher, $out, $out, $in) array(&$this->Dispatcher, $out, $out, $in)
); );
$collection = new ComponentCollection(); $collection = new ComponentCollection();

View file

@ -144,7 +144,6 @@ class ShellTest extends CakeTestCase {
public function testConstruct() { public function testConstruct() {
$this->assertEquals($this->Dispatcher, $this->Shell->Dispatch); $this->assertEquals($this->Dispatcher, $this->Shell->Dispatch);
$this->assertEqual($this->Shell->name, 'TestShell'); $this->assertEqual($this->Shell->name, 'TestShell');
$this->assertEqual($this->Shell->alias, 'TestShell');
$this->assertType('ConsoleOutput', $this->Shell->stdout); $this->assertType('ConsoleOutput', $this->Shell->stdout);
$this->assertType('ConsoleOutput', $this->Shell->stderr); $this->assertType('ConsoleOutput', $this->Shell->stderr);
} }

View file

@ -97,12 +97,12 @@ class TestSuiteShellTest extends CakeTestCase {
public function testRunnerOptions() { public function testRunnerOptions() {
$this->Shell->startup(); $this->Shell->startup();
$this->Shell->args = array('core', 'Basics'); $this->Shell->args = array('core', 'Basics');
$this->Shell->params = array('filter' => 'myFilter', '-colors' => null, '-verbose' => null); $this->Shell->params = array('filter' => 'myFilter', 'colors' => null, 'verbose' => null);
$this->Shell->expects($this->once())->method('run') $this->Shell->expects($this->once())->method('run')
->with( ->with(
array('app' => false, 'plugin' => null, 'output' => 'text', 'case' => 'basics'), array('app' => false, 'plugin' => null, 'output' => 'text', 'case' => 'basics'),
array('--colors', '--verbose', '--filter', 'myFilter') array('--filter', 'myFilter', '--colors', '--verbose')
); );
$this->Shell->main(); $this->Shell->main();
} }