mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing occurances of CakeTestsGetReporter and fixing issues loading reporters.
This commit is contained in:
parent
dd5a886f3a
commit
9a62fd52b3
1 changed files with 6 additions and 8 deletions
|
@ -121,16 +121,14 @@ class CakeTestSuiteDispatcher {
|
|||
function &getReporter() {
|
||||
static $Reporter = NULL;
|
||||
if (!$Reporter) {
|
||||
$coreClass = 'Cake' . $this->params['output'] . 'Reporter';
|
||||
$coreClass = 'Cake' . ucwords($this->params['output']) . 'Reporter';
|
||||
$coreFile = CAKE_TESTS_LIB . 'cake_' . strtolower($this->params['output']) . '_reporter.php';
|
||||
|
||||
|
||||
$appClass = $this->params['output'] . 'Reporter';
|
||||
$appFile = APPLIBS . 'test_suite' . DS . strtolower($this->params['output']) . '_reporter.php';
|
||||
if (file_exists($coreFile)) {
|
||||
require_once $coreFile;
|
||||
if (include_once $coreFile) {
|
||||
$Reporter =& new $coreClass();
|
||||
} elseif (file_exists($appFile)) {
|
||||
require_once $appFile;
|
||||
} elseif (include_once $appFile) {
|
||||
$Reporter =& new $appClass();
|
||||
}
|
||||
}
|
||||
|
@ -187,10 +185,10 @@ class CakeTestSuiteDispatcher {
|
|||
*/
|
||||
function _runTestCase() {
|
||||
if ($this->params['codeCoverage']) {
|
||||
CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter());
|
||||
CodeCoverageManager::start($_GET['case'], CakeTestSuiteDispatcher::getReporter());
|
||||
}
|
||||
|
||||
TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
|
||||
TestManager::runTestCase($_GET['case'], CakeTestSuiteDispatcher::getReporter());
|
||||
|
||||
if ($this->params['codeCoverage']) {
|
||||
CodeCoverageManager::report();
|
||||
|
|
Loading…
Reference in a new issue