mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
TestShell passes the 'directive' option to PHPUnit correctly
This commit is contained in:
parent
0a22058e35
commit
e71d83c612
2 changed files with 24 additions and 1 deletions
|
@ -152,6 +152,7 @@ class TestShell extends Shell {
|
|||
'default' => false
|
||||
))->addOption('directive', array(
|
||||
'help' => __d('cake_console', 'key[=value] Sets a php.ini value.'),
|
||||
'short' => 'd',
|
||||
'default' => false
|
||||
))->addOption('fixture', array(
|
||||
'help' => __d('cake_console', 'Choose a custom fixture manager.')
|
||||
|
@ -234,7 +235,11 @@ class TestShell extends Shell {
|
|||
if ($value === false) {
|
||||
continue;
|
||||
}
|
||||
$options[] = '--' . $param;
|
||||
if ($param === 'directive') {
|
||||
$options[] = '-d';
|
||||
} else {
|
||||
$options[] = '--' . $param;
|
||||
}
|
||||
if (is_string($value)) {
|
||||
$options[] = $value;
|
||||
}
|
||||
|
|
|
@ -359,4 +359,22 @@ class TestShellTest extends CakeTestCase {
|
|||
);
|
||||
$this->Shell->main();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that the '--directive' parameter change to '-d' before calling PHPUnit
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testRunnerOptionsDirective() {
|
||||
$this->Shell->startup();
|
||||
$this->Shell->args = array('core', 'Basics');
|
||||
$this->Shell->params = array('directive' => 'memory_limit=128M');
|
||||
|
||||
$this->Shell->expects($this->once())->method('_run')
|
||||
->with(
|
||||
array('app' => false, 'plugin' => null, 'core' => true, 'output' => 'text', 'case' => 'Basics'),
|
||||
array('-d', 'memory_limit=128M', '--colors')
|
||||
);
|
||||
$this->Shell->main();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue