bootstrap.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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('VENDOR_PATH', realpath(__DIR__ . '/../vendor'));
  13. set_include_path(implode(PATH_SEPARATOR, array(
  14. VENDOR_PATH,
  15. get_include_path(),
  16. )));
  17. $classLoaderFile = VENDOR_PATH . '/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
  18. if (!file_exists($classLoaderFile)) {
  19. die('cannot find vendor, git submodule init && git submodule update');
  20. }
  21. require_once $classLoaderFile;
  22. $classLoader = new Doctrine\Common\ClassLoader(
  23. 'Doctrine\ORM', 'doctrine-orm/lib'
  24. );
  25. $classLoader->register();
  26. $classLoader = new Doctrine\Common\ClassLoader(
  27. 'Doctrine\DBAL', 'doctrine-dbal/lib'
  28. );
  29. $classLoader->register();
  30. $classLoader = new Doctrine\Common\ClassLoader(
  31. 'Doctrine\MongoDB', 'doctrine-mongodb/lib'
  32. );
  33. $classLoader->register();
  34. $classLoader = new Doctrine\Common\ClassLoader(
  35. 'Doctrine\ODM', 'doctrine-mongodb-odm/lib'
  36. );
  37. $classLoader->register();
  38. $classLoader = new Doctrine\Common\ClassLoader(
  39. 'Doctrine', 'doctrine-common/lib'
  40. );
  41. $classLoader->register();
  42. $classLoader = new Doctrine\Common\ClassLoader('Symfony');
  43. $classLoader->register();
  44. $classLoader = new Doctrine\Common\ClassLoader('Gedmo', __DIR__ . '/../lib');
  45. $classLoader->register();
  46. // fixture autoloaders
  47. $classLoader = new Doctrine\Common\ClassLoader('Translatable\Fixture', __DIR__ . '/Gedmo');
  48. $classLoader->register();
  49. $classLoader = new Doctrine\Common\ClassLoader('Tree\Fixture', __DIR__ . '/Gedmo');
  50. $classLoader->register();
  51. $classLoader = new Doctrine\Common\ClassLoader('Timestampable\Fixture', __DIR__ . '/Gedmo');
  52. $classLoader->register();
  53. $classLoader = new Doctrine\Common\ClassLoader('Sluggable\Fixture', __DIR__ . '/Gedmo');
  54. $classLoader->register();
  55. $classLoader = new Doctrine\Common\ClassLoader('Mapping\Fixture', __DIR__ . '/Gedmo');
  56. $classLoader->register();