Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Report generation only generates a usefull result when Xdebug is avai…

…lable.
  • Loading branch information...
commit 21b38575f99ea7cbbcf5406e5b22abf600bbd656 1 parent 2aae416
Sebastian Bergmann authored
Showing with 8 additions and 5 deletions.
  1. +4 −3 PHPUnit/TextUI/Command.php
  2. +4 −2 PHPUnit/TextUI/TestRunner.php
7 PHPUnit/TextUI/Command.php
View
@@ -135,7 +135,6 @@ protected static function handleArguments()
'log-tap=',
'log-xml=',
'repeat=',
- 'report=',
'skeleton',
'tap',
'testdox-html=',
@@ -149,6 +148,10 @@ protected static function handleArguments()
$longOptions[] = 'log-graphviz=';
}
+ if (extension_loaded('xdebug')) {
+ $longOptions[] = 'report=';
+ }
+
try {
$options = PHPUnit_Util_Getopt::getopt(
$_SERVER['argv'],
@@ -377,8 +380,6 @@ public static function showHelp()
if (extension_loaded('xdebug')) {
print " --report <dir> Generate combined test/coverage report in HTML format.\n";
- } else {
- print " --report <dir> Generate test report in HTML format.\n";
}
print " --testdox-html <file> Write agile documentation in HTML format to file.\n" .
6 PHPUnit/TextUI/TestRunner.php
View
@@ -215,7 +215,8 @@ public function doRun(PHPUnit_Framework_Test $suite, Array $parameters = array()
}
}
- if (isset($parameters['reportDirectory'])) {
+ if (isset($parameters['reportDirectory']) &&
+ extension_loaded('xdebug')) {
if (class_exists('Image_GraphViz', FALSE)) {
$result->addListener(
new PHPUnit_Util_Report_GraphViz($parameters['reportDirectory'])
@@ -253,7 +254,8 @@ public function doRun(PHPUnit_Framework_Test $suite, Array $parameters = array()
$this->printer->printResult($result, $timeElapsed);
}
- if (isset($parameters['reportDirectory'])) {
+ if (isset($parameters['reportDirectory']) &&
+ extension_loaded('xdebug')) {
$this->printer->write("\nGenerating report, this may take a moment.");
PHPUnit_Util_Report::render($result, $parameters['reportDirectory']);
$this->printer->write("\n");
Please sign in to comment.
Something went wrong with that request. Please try again.