TestInit.php 757 Bytes
Newer Older
jwage's avatar
jwage committed
1
<?php
romanb's avatar
romanb committed
2 3 4
/*
 * This file bootstraps the test environment.
 */
5
namespace Doctrine\Tests;
romanb's avatar
romanb committed
6

7 8
error_reporting(E_ALL | E_STRICT);

9 10 11 12 13 14 15 16 17
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?');
}
18

19 20 21
/* @var $classLoader \Composer\Autoload\ClassLoader */
$classLoader->add('Doctrine\\Tests\\', __DIR__ . '/../../');
unset($classLoader);