diff --git a/plugins/CoreConsole/Commands/TestsRun.php b/plugins/CoreConsole/Commands/TestsRun.php index 2ca498c6ebace2fccb48037926082b51b363cad6..a0304b06828d2ac555190c96671ce1f387c4c125 100644 --- a/plugins/CoreConsole/Commands/TestsRun.php +++ b/plugins/CoreConsole/Commands/TestsRun.php @@ -45,8 +45,12 @@ class TestsRun extends ConsoleCommand $command = '../../vendor/phpunit/phpunit/phpunit'; + if (!$this->isCoverageEnabled($options) && $this->isXdebugLoaded()) { + $output->writeln('<comment>Did you know? You can run tests faster by disabling xdebug</comment>'); + } + // force xdebug usage for coverage options - if (false !== strpos($options, '--coverage') && !extension_loaded('xdebug')) { + if ($this->isCoverageEnabled($options) && !$this->isXdebugLoaded()) { $output->writeln('<info>xdebug extension required for code coverage.</info>'); @@ -189,4 +193,14 @@ class TestsRun extends ConsoleCommand return ucfirst($suite) . 'Tests'; } + private function isCoverageEnabled($options) + { + return false !== strpos($options, '--coverage'); + } + + private function isXdebugLoaded() + { + return extension_loaded('xdebug'); + } + } \ No newline at end of file