diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index cc91a8226..1a4f48503 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -236,7 +236,6 @@ class CakeTestSuiteDispatcher { if (isset($_GET['code_coverage'])) { $this->params['codeCoverage'] = true; $this->_checkXdebug(); - require_once CAKE_TESTS_LIB . 'code_coverage_manager.php'; } $this->params['baseUrl'] = $this->_baseUrl; $this->params['baseDir'] = $this->_baseDir; @@ -250,9 +249,6 @@ class CakeTestSuiteDispatcher { */ function _runGroupTest() { $Reporter = CakeTestSuiteDispatcher::getReporter(); - if ($this->params['codeCoverage']) { - CodeCoverageManager::init($this->params['group'], $Reporter); - } if ('all' == $this->params['group']) { $this->Manager->runAllTests($Reporter); } else { @@ -267,9 +263,6 @@ class CakeTestSuiteDispatcher { */ function _runTestCase() { $Reporter = CakeTestSuiteDispatcher::getReporter(); - if ($this->params['codeCoverage']) { - CodeCoverageManager::init($this->params['case'], $Reporter); - } $this->Manager->runTestCase($this->params['case'], $Reporter, $this->params['codeCoverage']); } } diff --git a/cake/tests/lib/coverage/html_coverage_report.php b/cake/tests/lib/coverage/html_coverage_report.php new file mode 100644 index 000000000..4c1840a7e --- /dev/null +++ b/cake/tests/lib/coverage/html_coverage_report.php @@ -0,0 +1,35 @@ +_coverage = $coverage; + } + +/** + * Generates report html to display. + * + * @return string compiled html report. + */ + public function report() { + + } +} \ No newline at end of file diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 68d6dbd09..eec5de136 100755 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -175,16 +175,25 @@ class CakeHtmlReporter extends CakeBaseReporter implements PHPUnit_Framework_Tes } echo $this->_paintLinks(); echo ''; - if ( - isset($this->params['codeCoverage']) && - $this->params['codeCoverage'] && - class_exists('CodeCoverageManager') - ) { - //CodeCoverageManager::report(); + if (isset($this->params['codeCoverage']) && $this->params['codeCoverage']) { + $coverage = $result->getCodeCoverageInformation(); + echo $this->paintCoverage($coverage); } $this->paintDocumentEnd(); } +/** + * Paints a code coverage report. + * + * @return void + */ + public function paintCoverage($coverage) { + $file = dirname(dirname(__FILE__)) . '/coverage/html_coverage_report.php'; + include $file; + $reporter = new HtmlCoverageReport($coverage); + echo $reporter->report(); + } + /** * Renders the links that for accessing things in the test suite. * diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index 4bc51d509..31cec5c3e 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -61,12 +61,9 @@ class CakeTextReporter extends CakeBaseReporter { if (function_exists('memory_get_peak_usage')) { echo 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n"; } - if ( - isset($this->params['codeCoverage']) && - $this->params['codeCoverage'] && - class_exists('CodeCoverageManager') - ) { - CodeCoverageManager::report(); + if (isset($this->params['codeCoverage']) && $this->params['codeCoverage']) { + $coverage = $result->getCodeCoverageInformation(); + echo $this->paintCoverage($coverage); } } diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 07bb09993..67e35bc61 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -167,9 +167,6 @@ class TestManager { $reporter->paintHeader(); $this->getTestSuite()->run($result); $reporter->paintResult($result); - // echo '
'; - // var_dump($result->getCodeCoverageInformation()); - // echo ''; return $result; }