Skip to content

Commit

Permalink
Making CLI case code coverage reports include text.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 11, 2010
1 parent 84e70c1 commit 07b43be
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cake/tests/lib/code_coverage_manager.php
Expand Up @@ -681,7 +681,6 @@ function __paintGroupResultLineCli($file, $lineCount, $coveredCount) {
$manager =& CodeCoverageManager::getInstance();
$codeCoverage = $manager->__calcCoverage($lineCount, $coveredCount);
$class = 'bad';

if ($codeCoverage > 50) {
$class = 'ok';
}
Expand All @@ -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";
}

/**
Expand Down

0 comments on commit 07b43be

Please sign in to comment.