mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixing failing tests caused by API changes.
This commit is contained in:
parent
9540f9aeff
commit
8c990a9e08
6 changed files with 10 additions and 16 deletions
|
@ -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 @@ class Shell extends Object {
|
|||
}
|
||||
|
||||
$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 @@ class TestSuiteShell extends Shell {
|
|||
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 @@ class TestSuiteShell extends Shell {
|
|||
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 @@ class AclShellTest extends CakeTestCase {
|
|||
);
|
||||
$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 @@ class ShellTest extends CakeTestCase {
|
|||
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 @@ class TestSuiteShellTest extends CakeTestCase {
|
|||
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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue