From 5b41a9b52da28ea53f3c72a781e3559c14a6c60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Tue, 22 Sep 2015 13:35:42 +0200 Subject: [PATCH] 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 --- lib/Cake/Console/Command/TestShell.php | 1 + .../Case/Console/Command/TestShellTest.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/Cake/Console/Command/TestShell.php b/lib/Cake/Console/Command/TestShell.php index 15012bfeb..7d17899a9 100644 --- a/lib/Cake/Console/Command/TestShell.php +++ b/lib/Cake/Console/Command/TestShell.php @@ -222,6 +222,7 @@ class TestShell extends Shell { $options = array(); $params = $this->params; unset($params['help']); + unset($params['quiet']); if (!empty($params['no-colors'])) { unset($params['no-colors'], $params['colors']); diff --git a/lib/Cake/Test/Case/Console/Command/TestShellTest.php b/lib/Cake/Test/Case/Console/Command/TestShellTest.php index 132f6ed1e..d3d379a1d 100644 --- a/lib/Cake/Test/Case/Console/Command/TestShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/TestShellTest.php @@ -341,4 +341,22 @@ class TestShellTest extends CakeTestCase { ); $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(); + } }