bootstrap.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * This is bootstrap for phpUnit unit tests,
  4. * use README.md for more details
  5. *
  6. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  7. * @package Gedmo.Tests
  8. * @link http://www.gediminasm.org
  9. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  10. */
  11. define('TESTS_PATH', __DIR__);
  12. define('TESTS_TEMP_DIR', __DIR__.'/temp');
  13. define('VENDOR_PATH', realpath(__DIR__ . '/../vendor'));
  14. set_include_path(implode(PATH_SEPARATOR, array(
  15. VENDOR_PATH,
  16. get_include_path(),
  17. )));
  18. $classLoaderFile = VENDOR_PATH . '/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
  19. if (!file_exists($classLoaderFile)) {
  20. die('cannot find vendor, git submodule init && git submodule update');
  21. }
  22. require_once $classLoaderFile;
  23. $classLoader = new Doctrine\Common\ClassLoader(
  24. 'Doctrine\ORM', 'doctrine-orm/lib'
  25. );
  26. $classLoader->register();
  27. $classLoader = new Doctrine\Common\ClassLoader(
  28. 'Doctrine\DBAL', 'doctrine-dbal/lib'
  29. );
  30. $classLoader->register();
  31. $classLoader = new Doctrine\Common\ClassLoader(
  32. 'Doctrine\MongoDB', 'doctrine-mongodb/lib'
  33. );
  34. $classLoader->register();
  35. $classLoader = new Doctrine\Common\ClassLoader(
  36. 'Doctrine\ODM', 'doctrine-mongodb-odm/lib'
  37. );
  38. $classLoader->register();
  39. $classLoader = new Doctrine\Common\ClassLoader(
  40. 'Doctrine', 'doctrine-common/lib'
  41. );
  42. $classLoader->register();
  43. $classLoader = new Doctrine\Common\ClassLoader('Gedmo\Mapping\Mock', __DIR__);
  44. $classLoader->register();
  45. $classLoader = new Doctrine\Common\ClassLoader('Symfony');
  46. $classLoader->register();
  47. $classLoader = new Doctrine\Common\ClassLoader('Gedmo', __DIR__ . '/../lib');
  48. $classLoader->register();
  49. $classLoader = new Doctrine\Common\ClassLoader('Tool', __DIR__ . '/Gedmo');
  50. $classLoader->register();
  51. // fixture autoloaders
  52. $classLoader = new Doctrine\Common\ClassLoader('Translatable\Fixture', __DIR__ . '/Gedmo');
  53. $classLoader->register();
  54. $classLoader = new Doctrine\Common\ClassLoader('Tree\Fixture', __DIR__ . '/Gedmo');
  55. $classLoader->register();
  56. $classLoader = new Doctrine\Common\ClassLoader('Timestampable\Fixture', __DIR__ . '/Gedmo');
  57. $classLoader->register();
  58. $classLoader = new Doctrine\Common\ClassLoader('Sluggable\Fixture', __DIR__ . '/Gedmo');
  59. $classLoader->register();
  60. $classLoader = new Doctrine\Common\ClassLoader('Mapping\Fixture', __DIR__ . '/Gedmo');
  61. $classLoader->register();
  62. $classLoader = new Doctrine\Common\ClassLoader('Loggable\Fixture', __DIR__ . '/Gedmo');
  63. $classLoader->register();