Skip to content

Commit

Permalink
Swallow the "--quiet" shell parameter before calling PHPUnit.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ravage84 committed Sep 22, 2015
1 parent 851ff44 commit 5b41a9b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Cake/Console/Command/TestShell.php
Expand Up @@ -222,6 +222,7 @@ protected function _runnerOptions() {
$options = array();
$params = $this->params;
unset($params['help']);
unset($params['quiet']);

if (!empty($params['no-colors'])) {
unset($params['no-colors'], $params['colors']);
Expand Down
18 changes: 18 additions & 0 deletions lib/Cake/Test/Case/Console/Command/TestShellTest.php
Expand Up @@ -341,4 +341,22 @@ public function testRunnerOptions() {
);
$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();
}
}

0 comments on commit 5b41a9b

Please sign in to comment.