mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Be compatible with PHPUnit installed with composer.
Doing a class_exists() check is a simple way to check for PHPUnit being installed via an autoloader. It also keeps things compatible with a Vendor dir installation. Fixes #3721
This commit is contained in:
parent
61cc9b300c
commit
386be52c71
1 changed files with 5 additions and 2 deletions
|
@ -137,6 +137,9 @@ class CakeTestSuiteDispatcher {
|
|||
* @return boolean true if found, false otherwise
|
||||
*/
|
||||
public function loadTestFramework() {
|
||||
if (class_exists('PHPUnit_Framework_TestCase')) {
|
||||
return true;
|
||||
}
|
||||
foreach (App::path('vendors') as $vendor) {
|
||||
$vendor = rtrim($vendor, DS);
|
||||
if (is_dir($vendor . DS . 'PHPUnit')) {
|
||||
|
@ -144,8 +147,8 @@ class CakeTestSuiteDispatcher {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (include ('PHPUnit' . DS . 'Autoload.php')) !== false;
|
||||
include 'PHPUnit' . DS . 'Autoload.php';
|
||||
return class_exists('PHPUnit_Framework_TestCase');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue