Changed the order of the include for the custom reporter and added file_exists() to prevent errors.

This commit is contained in:
Frank de Graaf 2011-10-04 09:43:35 +02:00
parent 534291a1a6
commit 69ba1965b8

View file

@ -184,10 +184,10 @@ class CakeTestSuiteDispatcher {
$appClass = $this->params['output'] . 'Reporter'; $appClass = $this->params['output'] . 'Reporter';
$appFile = APPLIBS . 'test_suite' . DS . 'reporter' . DS . $type . '_reporter.php'; $appFile = APPLIBS . 'test_suite' . DS . 'reporter' . DS . $type . '_reporter.php';
if (include_once $coreFile) { if (file_exists($appFile) && include_once $appFile) {
$Reporter =& new $coreClass(null, $this->params);
} elseif (include_once $appFile) {
$Reporter =& new $appClass(null, $this->params); $Reporter =& new $appClass(null, $this->params);
} elseif (include_once $coreFile) {
$Reporter =& new $coreClass(null, $this->params);
} }
} }
return $Reporter; return $Reporter;