Skip to content
Permalink
Browse files

Fixing failing tests caused by API changes.

  • Loading branch information...
markstory committed Oct 11, 2010
1 parent 9540f9a commit 8c990a9e083a59e7c1110d2eeee5a04370efa907
@@ -31,9 +31,9 @@ class CommandListShell extends Shell {
*/
public function main() {
$this->out("<info>Current Paths:</info>", 2);
$this->out(" -app: ". $this->params['app']);
$this->out(" -working: " . rtrim($this->params['working'], DS));
$this->out(" -root: " . rtrim($this->params['root'], DS));
$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(" -core: " . rtrim(CORE_PATH, DS));
$this->out("");
$this->out("<info>Changing Paths:</info>", 2);
@@ -325,7 +325,7 @@ public function runCommand($command, $argv) {
}
$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' ) {
$this->startup();
@@ -74,9 +74,6 @@ protected function parseArgs() {
if (isset($this->args[1])) {
$params['case'] = Inflector::underscore($this->args[1]);
}
if (isset($this->params['filter'])) {
$this->params['-filter'] = $this->params['filter'];
}
return $params;
}
@@ -88,11 +85,9 @@ protected function parseArgs() {
protected function runnerOptions() {
$options = array();
foreach ($this->params as $param => $value) {
if ($param[0] === '-') {
$options[] = '-' . $param;
if (is_string($value)) {
$options[] = $value;
}
$options[] = '--' . $param;
if (is_string($value)) {
$options[] = $value;
}
}
return $options;
@@ -58,7 +58,7 @@ public function setUp() {
);
$this->Task = $this->getMock(
'AclShell',
array('in', 'out', 'hr', 'createFile', 'error', 'err'),
array('in', 'out', 'hr', 'createFile', 'error', 'err', 'clear'),
array(&$this->Dispatcher, $out, $out, $in)
);
$collection = new ComponentCollection();
@@ -144,7 +144,6 @@ public function tearDown() {
public function testConstruct() {
$this->assertEquals($this->Dispatcher, $this->Shell->Dispatch);
$this->assertEqual($this->Shell->name, 'TestShell');
$this->assertEqual($this->Shell->alias, 'TestShell');
$this->assertType('ConsoleOutput', $this->Shell->stdout);
$this->assertType('ConsoleOutput', $this->Shell->stderr);
}
@@ -97,12 +97,12 @@ public function testAvailableCoreCategory() {
public function testRunnerOptions() {
$this->Shell->startup();
$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')
->with(
array('app' => false, 'plugin' => null, 'output' => 'text', 'case' => 'basics'),
array('--colors', '--verbose', '--filter', 'myFilter')
array('--filter', 'myFilter', '--colors', '--verbose')
);
$this->Shell->main();
}

0 comments on commit 8c990a9

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