Skip to content

Commit

Permalink
Merge pull request #770 from doctrine/composer-autoload-dev
Browse files Browse the repository at this point in the history
Moved Doctrine\Tests namespace to composer autoload-dev.
  • Loading branch information
guilhermeblanco committed Jan 11, 2015
2 parents 32fae86 + c5e5d59 commit 94e5e55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"autoload": {
"psr-0": { "Doctrine\\DBAL\\": "lib/" }
},
"autoload-dev": {
"psr-0": { "Doctrine\\Tests\\": "tests/" }
},
"extra": {
"branch-alias": {
"dev-master": "2.6.x-dev"
Expand Down
8 changes: 2 additions & 6 deletions tests/Doctrine/Tests/TestInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@

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);

0 comments on commit 94e5e55

Please sign in to comment.