From 9201d09ab7feda250a01082a315c53adc9cd2f50 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Sat, 10 Jan 2015 20:28:57 +0000 Subject: [PATCH] Fixed phpunit tests autoload requirements and moved to composer autoload-dev configuration. --- composer.json | 3 +++ tests/Doctrine/Tests/TestInit.php | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 80dc114f0..3b90dff5c 100644 --- a/composer.json +++ b/composer.json @@ -31,6 +31,9 @@ "autoload": { "psr-0": { "Doctrine\\ORM\\": "lib/" } }, + "autoload-dev": { + "psr-0": { "Doctrine\\Tests\\": "tests/" } + }, "bin": ["bin/doctrine", "bin/doctrine.php"], "extra": { "branch-alias": { diff --git a/tests/Doctrine/Tests/TestInit.php b/tests/Doctrine/Tests/TestInit.php index f974c9915..1ad733376 100644 --- a/tests/Doctrine/Tests/TestInit.php +++ b/tests/Doctrine/Tests/TestInit.php @@ -9,18 +9,14 @@ date_default_timezone_set('UTC'); if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { // 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')) { // installed as a dependency in `vendor` - $classLoader = require __DIR__ . '/../../../../../autoload.php'; + 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); - if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) { throw new \Exception("Could not create " . __DIR__."/Proxies Folder."); }