Skip to content

Commit

Permalink
Refactoring loops in CodeCoverageManager
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 10, 2010
1 parent 6458072 commit 5a88aaf
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions cake/tests/lib/code_coverage_manager.php
Expand Up @@ -105,7 +105,6 @@ function init($testCaseFile, &$reporter) {
} }
$manager->setParams($reporter); $manager->setParams($reporter);
$manager->testCaseFile = $testCaseFile; $manager->testCaseFile = $testCaseFile;
CodeCoverageManager::start();
} }


/** /**
Expand Down Expand Up @@ -180,11 +179,8 @@ function report($output = true) {
$dump = xdebug_get_code_coverage(); $dump = xdebug_get_code_coverage();
$coverageData = array(); $coverageData = array();


foreach ($dump as $file => $data) { if (isset($dump[$testObjectFile])) {
if ($file == $testObjectFile) { $coverageData = $dump[$testObjectFile];
$coverageData = $data;
break;
}
} }


if (empty($coverageData) && $output) { if (empty($coverageData) && $output) {
Expand Down Expand Up @@ -215,9 +211,10 @@ function report($output = true) {
} }
$dump = xdebug_get_code_coverage(); $dump = xdebug_get_code_coverage();
$coverageData = array(); $coverageData = array();
foreach ($dump as $file => $data) {
if (in_array($file, $testObjectFiles)) { foreach ($testObjectFiles as $file) {
$coverageData[$file] = $data; if (isset($dump[$file])) {
$coverageData[$file] = $dump[$file];
} }
} }


Expand Down

0 comments on commit 5a88aaf

Please sign in to comment.