Skip to content
Browse files

Fixing bad include on text reporter.

Fixing bad includes and updating usage in text coverage reports.
  • Loading branch information...
1 parent fb756c5 commit 10c78c54204581400b0735fe09e98e8712f4a5db @markstory markstory committed
View
4 lib/Cake/TestSuite/Coverage/TextCoverageReport.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once dirname(__FILE__) . '/base_coverage_report.php';
+App::uses('BaseCoverageReport', 'TestSuite/Coverage');
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
@@ -56,4 +56,4 @@ public function generateDiff($filename, $fileLines, $coverageData) {
return "$filename : $percentCovered%\n";
}
-}
+}
View
7 lib/Cake/TestSuite/Reporter/CakeTextReporter.php
@@ -17,7 +17,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-include_once dirname(__FILE__) . DS . 'cake_base_reporter.php';
+App::uses('CakeBaseReporter', 'TestSuite/Reporter');
+App::uses('TextCoverageReport', 'TestSuite/Coverage');
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
@@ -91,7 +92,7 @@ public function paintFooter($result) {
echo 'Peak memory: ' . number_format(memory_get_peak_usage()) . " bytes\n";
if (isset($this->params['codeCoverage']) && $this->params['codeCoverage']) {
- $coverage = $result->getCodeCoverageInformation();
+ $coverage = $result->getCodeCoverage()->getSummary();
echo $this->paintCoverage($coverage);
}
}
@@ -184,8 +185,6 @@ public function testCaseList() {
* @return string
*/
public function paintCoverage($coverage) {
- $file = dirname(dirname(__FILE__)) . '/coverage/text_coverage_report.php';
- include $file;
$reporter = new TextCoverageReport($coverage, $this);
echo $reporter->report();
}

0 comments on commit 10c78c5

Please sign in to comment.
Something went wrong with that request. Please try again.