Guest User

Untitled

a guest
Aug 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2. echo "Bootstrapping" . PHP_EOL;
  3.  
  4. date_default_timezone_set('Europe/Helsinki');
  5. error_reporting(E_ALL | E_STRICT);
  6.  
  7. $testDir = realpath(dirname(__FILE__));
  8. $extlibs = realpath(dirname(__FILE__).'/../../libs');
  9. $appDir = realpath($testDir . '/../../app');
  10.  
  11. set_include_path(
  12. realpath($testDir . '/../../libs')
  13. . PATH_SEPARATOR . realpath($appDir . '/lib/propel')
  14. . PATH_SEPARATOR . realpath($testDir . '/lib')
  15. . PATH_SEPARATOR . get_include_path()
  16. );
  17.  
  18. require_once('agavi/agavi.php');
  19. require_once('agavi/testing/AgaviTesting.class.php');
  20.  
  21. AgaviConfig::set('core.testing_dir', realpath(dirname(__FILE__)));
  22. AgaviConfig::set("tests.dir", $testDir); // where the main tests dir resides
  23. AgaviConfig::set('core.app_dir', $appDir);
  24. AgaviConfig::set('ec.components_path', $extlibs . '/eccomponents');
  25. AgaviConfig::set('core.default_context', 'web');
  26.  
  27. echo "Emptying cache ";
  28. $cacheConfigDir = $appDir . '/cache/config';
  29. foreach (glob($cacheConfigDir . '/*.php') as $file) {
  30. unlink($file);
  31. }
  32. echo "...done" . PHP_EOL;
  33.  
  34. AgaviTesting::bootstrap('testing');
  35.  
  36. $_SERVER['REMOTE_ADDR'] = '0.0.0.0';
Add Comment
Please, Sign In to add comment