mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-05 14:23:36 +00:00
Updating code coverage tools to use raw data which includes dead and uncovered line data.
This commit is contained in:
parent
9a20a2344b
commit
75d7146bd0
3 changed files with 6 additions and 4 deletions
cake/tests/lib/coverage
|
@ -120,7 +120,7 @@ class HtmlCoverageReport {
|
|||
public function filterCoverageDataByPath($path) {
|
||||
$files = array();
|
||||
foreach ($this->_rawCoverage as $testRun) {
|
||||
foreach ($testRun['files'] as $filename => $fileCoverage) {
|
||||
foreach ($testRun['data'] as $filename => $fileCoverage) {
|
||||
if (strpos($filename, $path) !== 0) {
|
||||
continue;
|
||||
}
|
||||
|
@ -136,6 +136,7 @@ class HtmlCoverageReport {
|
|||
}
|
||||
}
|
||||
}
|
||||
ksort($files);
|
||||
return $files;
|
||||
}
|
||||
|
||||
|
@ -214,7 +215,7 @@ class HtmlCoverageReport {
|
|||
$diff[] = $this->_paintLine($line, $lineno, $class);
|
||||
}
|
||||
|
||||
$percentCovered = round($covered / $total, 2);
|
||||
$percentCovered = round(100 * $covered / $total, 2);
|
||||
|
||||
$output .= $this->coverageHeader($filename, $percentCovered);
|
||||
$output .= implode("", $diff);
|
||||
|
@ -243,6 +244,7 @@ class HtmlCoverageReport {
|
|||
* @return void
|
||||
*/
|
||||
public function coverageHeader($filename, $percent) {
|
||||
$filename = basename($filename);
|
||||
return <<<HTML
|
||||
<h2>$filename Code coverage: $percent%</h2>
|
||||
<div class="code-coverage-results">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue