mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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.
This commit is contained in:
parent
ad237ec681
commit
c2eae6caf8
2 changed files with 15 additions and 3 deletions
|
@ -66,7 +66,12 @@ class CakeTestRunner extends PHPUnit_TextUI_TestRunner {
|
|||
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 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue