TestInit.php 717 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file bootstraps the test environment.
  4. */
  5. namespace Doctrine\Tests;
  6. error_reporting(E_ALL | E_STRICT);
  7. // register silently failing autoloader
  8. spl_autoload_register(function($class)
  9. {
  10. if (0 === strpos($class, 'Doctrine\Tests\\')) {
  11. $path = __DIR__.'/../../'.strtr($class, '\\', '/').'.php';
  12. if (is_file($path) && is_readable($path)) {
  13. require_once $path;
  14. return true;
  15. }
  16. } else if (0 === strpos($class, 'Doctrine\Common\\')) {
  17. $path = __DIR__.'/../../../lib/'.($class = strtr($class, '\\', '/')).'.php';
  18. if (is_file($path) && is_readable($path)) {
  19. require_once $path;
  20. return true;
  21. }
  22. }
  23. });