Skip to content

Commit

Permalink
Nerfing coverage generation with PHPUnit3.6 for now.
Browse files Browse the repository at this point in the history
PHPUnit3.6 totally changed how coverage data can be accessed, its going
to take some time to update things.  This is a quick work around until
more time can be dedicated to fixing it.
  • Loading branch information
markstory committed Nov 5, 2011
1 parent ad237ec commit c2eae6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion lib/Cake/TestSuite/CakeTestRunner.php
Expand Up @@ -66,7 +66,12 @@ public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array())
protected function createTestResult() {
$result = new PHPUnit_Framework_TestResult;
if (!empty($this->_params['codeCoverage'])) {
$result->collectCodeCoverageInformation(true);
if (method_exists($result, 'collectCodeCoverageInformation')) {
$result->collectCodeCoverageInformation(true);
}
if (method_exists($result, 'setCodeCoverage')) {
$result->setCodeCoverage(new PHP_CodeCoverage());
}
}
return $result;
}
Expand Down
11 changes: 9 additions & 2 deletions lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
Expand Up @@ -141,8 +141,15 @@ public function paintFooter($result) {
echo $this->_paintLinks();
echo '</div>';
if (isset($this->params['codeCoverage']) && $this->params['codeCoverage']) {
$coverage = $result->getCodeCoverage()->getSummary();
echo $this->paintCoverage($coverage);
$coverage = $result->getCodeCoverage();
if (method_exists($coverage, 'getSummary')) {
$report = $coverage->getSummary();
echo $this->paintCoverage($report);
}
if (method_exists($coverage, 'getData')) {
$report = $coverage->getData();
echo '<div class="cake-error">' . __('Coverage generation is not supported with PHPUnit 3.6 at this time.') . '</div>';
}
}
$this->paintDocumentEnd();
}
Expand Down

0 comments on commit c2eae6c

Please sign in to comment.