Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 386be52c71a34621d60373a29c19f178864f0223 1 parent 61cc9b3
@markstory markstory authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
View
7 lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
@@ -137,6 +137,9 @@ protected function _checkPHPUnit() {
* @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 @@ public function loadTestFramework() {
break;
}
}
-
- return (include ('PHPUnit' . DS . 'Autoload.php')) !== false;
+ include 'PHPUnit' . DS . 'Autoload.php';
+ return class_exists('PHPUnit_Framework_TestCase');
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.