菜谱项目

TestInit.php 717B

12345678910111213141516171819202122232425262728
  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. });