Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2014-12-10 04:44:10 +0300
committermattab <matthieu.aubry@gmail.com>2014-12-10 04:44:10 +0300
commitfd2024bb227bf5b4c3375616fe4a922a37b2851a (patch)
treeb1c07027c30f0966424631774256c50306076f5f
parent80341faefe4d32cbf6f8b347aa14a8369c2ff575 (diff)
If xdebug code coverage is enabled, write comment when running tests
-rw-r--r--plugins/TestRunner/Commands/TestsRun.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/TestRunner/Commands/TestsRun.php b/plugins/TestRunner/Commands/TestsRun.php
index 0aaef90049..e7b02512b3 100644
--- a/plugins/TestRunner/Commands/TestsRun.php
+++ b/plugins/TestRunner/Commands/TestsRun.php
@@ -47,7 +47,11 @@ 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>');
+ $message = 'Did you know? You can run tests faster by disabling xdebug';
+ if($this->isXdebugCodeCoverageEnabled()) {
+ $message .= ' (if you need xdebug, speed up tests by setting xdebug.coverage_enable=0)</comment>';
+ }
+ $output->writeln('<comment>' . $message .'</comment>');
}
// force xdebug usage for coverage options
@@ -255,6 +259,11 @@ class TestsRun extends ConsoleCommand
return extension_loaded('xdebug');
}
+ private function isXdebugCodeCoverageEnabled()
+ {
+ return (bool)ini_get('xdebug.coverage_enable');
+ }
+
private function fixPathToTestFileOrDirectory($testFile)
{
if ('/' !== substr($testFile, 0, 1)) {