Skip to content

Instantly share code, notes, and snippets.

@guilhermeblanco
Created January 10, 2015 20:24
Show Gist options
  • Save guilhermeblanco/8ba8caa4df59bc7da648 to your computer and use it in GitHub Desktop.
Save guilhermeblanco/8ba8caa4df59bc7da648 to your computer and use it in GitHub Desktop.
Doctrine\Tests fix
diff --git a/composer.json b/composer.json
index 80dc114..3b90dff 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 f974c99..1ad7333 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.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment