bootstrap.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * $Id: bootstrap.php 2892 2011-08-14 15:11:50Z markbaker@phpexcel.net $
  4. *
  5. * @copyright Copyright (C) 2012 Mark Baker. All rights reserved.
  6. * @package Complex
  7. * @subpackage Complex Unit Tests
  8. * @author Mark Baker
  9. */
  10. // PHP 5.3 Compatibility
  11. date_default_timezone_set('Europe/Amsterdam');
  12. // Define path to application directory
  13. defined('APPLICATION_PATH')
  14. || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../classes'));
  15. // Define path to application tests directory
  16. defined('APPLICATION_TESTS_PATH')
  17. || define('APPLICATION_TESTS_PATH', realpath(dirname(__FILE__)));
  18. // Define application environment
  19. defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'ci');
  20. // Ensure library/ is on include_path
  21. set_include_path(implode(PATH_SEPARATOR, array(
  22. realpath(APPLICATION_PATH),
  23. './',
  24. get_include_path(),
  25. )));
  26. /**
  27. * @todo Sort out xdebug in vagrant so that this works in all sandboxes
  28. * For now, it is safer to test for it rather then remove it.
  29. */
  30. echo "Complex tests beginning\n";
  31. if (extension_loaded('xdebug')) {
  32. echo "Xdebug extension loaded and running\n";
  33. xdebug_enable();
  34. } else {
  35. echo 'Xdebug not found, you should run the following at the command line:',
  36. 'echo "zend_extension=/usr/lib64/php/modules/xdebug.so" > /etc/php.d/xdebug.ini',
  37. "\n";
  38. }
  39. require_once(APPLICATION_TESTS_PATH . '/../vendor/autoload.php');
  40. // Load abstract base function test class.
  41. require_once APPLICATION_TESTS_PATH . '/BaseTestAbstract.php';
  42. require_once APPLICATION_TESTS_PATH . '/BaseFunctionTestAbstract.php';
  43. require_once APPLICATION_TESTS_PATH . '/BaseOperationTestAbstract.php';