Merge pull request #1243 from doctrine/composer-autoloader-dev
Fixed phpunit tests autoload requirements and moved to composer autoload-dev
This commit is contained in:
commit
4dbfdfb9d6
@ -31,6 +31,9 @@
|
|||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-0": { "Doctrine\\ORM\\": "lib/" }
|
"psr-0": { "Doctrine\\ORM\\": "lib/" }
|
||||||
},
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-0": { "Doctrine\\Tests\\": "tests/" }
|
||||||
|
},
|
||||||
"bin": ["bin/doctrine", "bin/doctrine.php"],
|
"bin": ["bin/doctrine", "bin/doctrine.php"],
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
|
@ -9,18 +9,14 @@ date_default_timezone_set('UTC');
|
|||||||
|
|
||||||
if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
|
if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
|
||||||
// dependencies were installed via composer - this is the main project
|
// dependencies were installed via composer - this is the main project
|
||||||
$classLoader = require __DIR__ . '/../../../vendor/autoload.php';
|
require __DIR__ . '/../../../vendor/autoload.php';
|
||||||
} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
|
} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
|
||||||
// installed as a dependency in `vendor`
|
// installed as a dependency in `vendor`
|
||||||
$classLoader = require __DIR__ . '/../../../../../autoload.php';
|
require __DIR__ . '/../../../../../autoload.php';
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?');
|
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);
|
|
||||||
|
|
||||||
if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) {
|
if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) {
|
||||||
throw new \Exception("Could not create " . __DIR__."/Proxies Folder.");
|
throw new \Exception("Could not create " . __DIR__."/Proxies Folder.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user