Commit 0087f3fe authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #382 from flip111/patch-4

Update TestInit.php for new autoloading stuff
parents 6cd3df41 330d31cf
......@@ -6,8 +6,16 @@ namespace Doctrine\Tests;
error_reporting(E_ALL | E_STRICT);
require_once __DIR__ . '/../../../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Tests', __DIR__ . '/../../');
$classLoader->register();
if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
// dependencies were installed via composer - this is the main project
$classLoader = require __DIR__ . '/../../../vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
// installed as a dependency in `vendor`
$classLoader = require __DIR__ . '/../../../../../autoload.php';
} else {
throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?');
}
/* @var $classLoader \Composer\Autoload\ClassLoader */
$classLoader->add('Doctrine\\Tests\\', __DIR__ . '/../../');
unset($classLoader);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment