TestInit.php 729 B

12345678910111213141516171819
  1. <?php
  2. /*
  3. * This file bootstraps the test environment.
  4. */
  5. error_reporting(E_ALL | E_STRICT);
  6. if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
  7. // dependencies were installed via composer - this is the main project
  8. $classLoader = require __DIR__ . '/../../../vendor/autoload.php';
  9. } elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
  10. // installed as a dependency in `vendor`
  11. $classLoader = require __DIR__ . '/../../../../../autoload.php';
  12. } else {
  13. throw new Exception('Can\'t find autoload.php. Did you install dependencies via Composer?');
  14. }
  15. /* @var $classLoader \Composer\Autoload\ClassLoader */
  16. $classLoader->add('Doctrine\\Tests\\', __DIR__ . '/../../');
  17. unset($classLoader);