Permalink
Browse files

Making CLI case code coverage reports include text.

  • Loading branch information...
1 parent 84e70c1 commit 07b43be1259212d7d4146d4f77d55cf0adf4b42c @markstory markstory committed Jan 11, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 cake/tests/lib/code_coverage_manager.php
@@ -681,7 +681,6 @@ function __paintGroupResultLineCli($file, $lineCount, $coveredCount) {
$manager =& CodeCoverageManager::getInstance();
$codeCoverage = $manager->__calcCoverage($lineCount, $coveredCount);
$class = 'bad';
-
if ($codeCoverage > 50) {
$class = 'ok';
}
@@ -702,7 +701,14 @@ function __paintGroupResultLineCli($file, $lineCount, $coveredCount) {
function __paintHeaderCli($lineCount, $coveredCount, $report) {
$manager =& CodeCoverageManager::getInstance();
$codeCoverage = $manager->__calcCoverage($lineCount, $coveredCount);
- return $report = 'Code Coverage: ' . $codeCoverage . '%';
+ $class = 'bad';
+ if ($codeCoverage > 50) {
+ $class = 'ok';
+ }
+ if ($codeCoverage > 80) {
+ $class = 'good';
+ }
+ return $report = "Code Coverage: $codeCoverage% ($class)\n";
}
/**

0 comments on commit 07b43be

Please sign in to comment.