mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Fixing issue where divide by 0 errors would crop up on empty files.
This commit is contained in:
parent
957a8d5c00
commit
6f8869631f
1 changed files with 4 additions and 1 deletions
|
@ -84,7 +84,10 @@ HTML;
|
|||
$diff[] = $this->_paintLine($line, $lineno, $class, $coveringTests);
|
||||
}
|
||||
|
||||
$percentCovered = round(100 * $covered / $total, 2);
|
||||
$percentCovered = 100;
|
||||
if ($total > 0) {
|
||||
$percentCovered = round(100 * $covered / $total, 2);
|
||||
}
|
||||
$output .= $this->coverageHeader($filename, $percentCovered);
|
||||
$output .= implode("", $diff);
|
||||
$output .= $this->coverageFooter();
|
||||
|
|
Loading…
Add table
Reference in a new issue