TestInit.php 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /*
  3. * This file bootstraps the test environment.
  4. */
  5. namespace Doctrine\Tests;
  6. error_reporting(E_ALL | E_STRICT);
  7. require_once __DIR__ . '/../../../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
  8. if (isset($GLOBALS['DOCTRINE_COMMON_PATH'])) {
  9. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', $GLOBALS['DOCTRINE_COMMON_PATH']);
  10. } else {
  11. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . '/../../../lib/vendor/doctrine-common/lib');
  12. }
  13. $classLoader->register();
  14. if (isset($GLOBALS['DOCTRINE_DBAL_PATH'])) {
  15. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', $GLOBALS['DOCTRINE_DBAL_PATH']);
  16. } else {
  17. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', __DIR__ . '/../../../lib/vendor/doctrine-dbal/lib');
  18. }
  19. $classLoader->register();
  20. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\ORM', __DIR__ . '/../../../lib');
  21. $classLoader->register();
  22. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Tests', __DIR__ . '/../../');
  23. $classLoader->register();
  24. $classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . "/../../../lib/vendor");
  25. $classLoader->register();
  26. if (!file_exists(__DIR__."/Proxies")) {
  27. if (!mkdir(__DIR__."/Proxies")) {
  28. throw new Exception("Could not create " . __DIR__."/Proxies Folder.");
  29. }
  30. }
  31. if (!file_exists(__DIR__."/ORM/Proxy/generated")) {
  32. if (!mkdir(__DIR__."/ORM/Proxy/generated")) {
  33. throw new Exception("Could not create " . __DIR__."/ORM/Proxy/generated Folder.");
  34. }
  35. }