Swallow the "--quiet" shell parameter before calling PHPUnit.

PHPUnit does not provide a silent or quiet mode, so we cannot pass it along:
https://phpunit.de/manual/3.7/en/phpunit-book.html#textui.clioptions

Resolves #7432
This commit is contained in:
Marc Würth 2015-09-22 13:35:42 +02:00
parent 851ff44b4c
commit 5b41a9b52d
2 changed files with 19 additions and 0 deletions

View file

@ -222,6 +222,7 @@ class TestShell extends Shell {
$options = array(); $options = array();
$params = $this->params; $params = $this->params;
unset($params['help']); unset($params['help']);
unset($params['quiet']);
if (!empty($params['no-colors'])) { if (!empty($params['no-colors'])) {
unset($params['no-colors'], $params['colors']); unset($params['no-colors'], $params['colors']);

View file

@ -341,4 +341,22 @@ class TestShellTest extends CakeTestCase {
); );
$this->Shell->main(); $this->Shell->main();
} }
/**
* Tests that the 'quiet' parameter gets swallowed before calling PHPUnit
*
* @return void
*/
public function testRunnerOptionsQuiet() {
$this->Shell->startup();
$this->Shell->args = array('core', 'Basics');
$this->Shell->params = array('quiet' => true);
$this->Shell->expects($this->once())->method('_run')
->with(
array('app' => false, 'plugin' => null, 'core' => true, 'output' => 'text', 'case' => 'Basics'),
array('--colors')
);
$this->Shell->main();
}
} }