Skip to content

Commit

Permalink
Fix --coverage-php and --coverage-text.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 2, 2011
1 parent 6ae460a commit 36bbe32
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ PHPUnit 3.6

This is the list of changes for the PHPUnit 3.6 release series.

PHPUnit 3.6.1
-------------

* Fixed `--coverage-php` and `--coverage-text`.

PHPUnit 3.6.0
-------------

Expand Down
28 changes: 16 additions & 12 deletions PHPUnit/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array())
}

if ((isset($arguments['coverageClover']) ||
isset($arguments['reportDirectory'])) &&
isset($arguments['reportDirectory']) ||
isset($arguments['coveragePHP']) ||
isset($arguments['coverageText'])) &&
extension_loaded('xdebug')) {
$codeCoverage = new PHP_CodeCoverage(
NULL, $this->codeCoverageFilter
Expand Down Expand Up @@ -325,6 +327,16 @@ public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array())
}

if (isset($codeCoverage)) {
$title = '';

if (isset($arguments['configuration'])) {
$loggingConfiguration = $arguments['configuration']->getLoggingConfiguration();

if (isset($loggingConfiguration['title'])) {
$title = $loggingConfiguration['title'];
}
}

if (isset($arguments['coverageClover'])) {
$this->printer->write(
"\nWriting code coverage data to XML file, this may take " .
Expand All @@ -343,16 +355,6 @@ public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array())
"\nGenerating code coverage report, this may take a moment."
);

$title = '';

if (isset($arguments['configuration'])) {
$loggingConfiguration = $arguments['configuration']->getLoggingConfiguration();

if (isset($loggingConfiguration['title'])) {
$title = $loggingConfiguration['title'];
}
}

$writer = new PHP_CodeCoverage_Report_HTML(
$title,
$arguments['reportCharset'],
Expand Down Expand Up @@ -727,7 +729,9 @@ protected function handleConfiguration(array &$arguments)
}

if ((isset($arguments['coverageClover']) ||
isset($arguments['reportDirectory'])) &&
isset($arguments['reportDirectory']) ||
isset($arguments['coveragePHP']) ||
isset($arguments['coverageText'])) &&
extension_loaded('xdebug')) {
$arguments['addUncoveredFilesFromWhitelist'] = $filterConfiguration['whitelist']['addUncoveredFilesFromWhitelist'];

Expand Down

0 comments on commit 36bbe32

Please sign in to comment.