Permalink
Browse files

Nerfing coverage generation with PHPUnit3.6 for now.

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...
1 parent ad237ec commit c2eae6caf8aca6ee387a36de2640221e8b0913db @markstory markstory committed Nov 5, 2011
Showing with 15 additions and 3 deletions.
  1. +6 −1 lib/Cake/TestSuite/CakeTestRunner.php
  2. +9 −2 lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
@@ -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;
}
@@ -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();
}

0 comments on commit c2eae6c

Please sign in to comment.