Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5 from munkie/class-coverage
Browse files Browse the repository at this point in the history
PHPUnit does not count classes with 0 methods as covered
  • Loading branch information
micheh committed Jul 22, 2018
2 parents b828dae + eb683c3 commit 7fcd92f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
/vendor
/composer.lock
3 changes: 2 additions & 1 deletion teamcity-clover.php
Expand Up @@ -35,7 +35,8 @@

$coveredClasses = 0;
foreach ($cloverXml->xpath('//class') as $class) {
if ((int) $class->metrics['coveredmethods'] === (int) $class->metrics['methods']) {
$methods = (int) $class->metrics['methods'];
if ($methods > 0 && $methods === (int) $class->metrics['coveredmethods']) {
$coveredClasses++;
}
}
Expand Down

0 comments on commit 7fcd92f

Please sign in to comment.