mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Renaming and refactoring method for checking existence of PHPUnit test framework
This commit is contained in:
parent
feec7f9a98
commit
5b999e6d79
1 changed files with 18 additions and 8 deletions
|
@ -118,7 +118,21 @@ class CakeTestSuiteDispatcher {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function _checkPHPUnit() {
|
||||
protected function _checkPHPUnit() {
|
||||
$found = $this->loadTestFramework();
|
||||
if (!$found) {
|
||||
$baseDir = $this->_baseDir;
|
||||
include CAKE_TESTS_LIB . 'templates/phpunit.php';
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for the existence of the test framework files
|
||||
*
|
||||
* @return boolean true if found, false otherwise
|
||||
*/
|
||||
public function loadTestFramework() {
|
||||
$found = $path = null;
|
||||
|
||||
if (@include 'PHPUnit' . DS . 'Framework.php') {
|
||||
|
@ -136,14 +150,10 @@ class CakeTestSuiteDispatcher {
|
|||
$found = include 'PHPUnit' . DS . 'Framework.php';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$baseDir = $this->_baseDir;
|
||||
include CAKE_TESTS_LIB . 'templates/phpunit.php';
|
||||
exit();
|
||||
if ($found) {
|
||||
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'DEFAULT');
|
||||
}
|
||||
|
||||
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'DEFAULT');
|
||||
return $found;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue