diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-10-09 15:04:37 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-10-09 15:04:37 +0400 |
commit | 3f8c6975783fc115765ef241db8d9ba48a8679ac (patch) | |
tree | 60a85b08ce3896846db590ad1255c019657ff28f /plugins | |
parent | 39887206fda4d237b260a370363139feda4d0d89 (diff) |
Instead of throwing exceptions, log a message in tracker.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreConsole/Commands/TestsRun.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/CoreConsole/Commands/TestsRun.php b/plugins/CoreConsole/Commands/TestsRun.php index 5f940acb83..5e00bd6230 100644 --- a/plugins/CoreConsole/Commands/TestsRun.php +++ b/plugins/CoreConsole/Commands/TestsRun.php @@ -88,7 +88,7 @@ class TestsRun extends ConsoleCommand private function executeTestFile($testFile, $options, $command, OutputInterface $output) { $params = $options . " " . $testFile; - $cmd = sprintf("cd %s/tests/PHPUnit && %s %s", PIWIK_DOCUMENT_ROOT, $command, $params); + $cmd = $this->getCommand($command, $params); $output->writeln('Executing command: <info>' . $cmd . '</info>'); passthru($cmd); $output->writeln(""); @@ -102,7 +102,7 @@ class TestsRun extends ConsoleCommand foreach ($groups as $group) { $params = '--group ' . $group . ' ' . str_replace('%group%', $group, $options); - $cmd = sprintf('cd %s/tests/PHPUnit && %s %s', PIWIK_DOCUMENT_ROOT, $command, $params); + $cmd = $this->getCommand($command, $params); $output->writeln('Executing command: <info>' . $cmd . '</info>'); passthru($cmd); $output->writeln(""); @@ -113,4 +113,15 @@ class TestsRun extends ConsoleCommand { return array('Core', 'Plugins', 'Integration', 'UI'); } + + /** + * @param $command + * @param $params + * @return string + */ + private function getCommand($command, $params) + { + $cmd = sprintf('cd %s/tests/PHPUnit && %s %s', PIWIK_DOCUMENT_ROOT, $command, $params); + return $cmd; + } }
\ No newline at end of file |