bootstrap.php 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of the Stash package.
  4. *
  5. * (c) Robert Hafner <tedivm@tedivm.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. define('TESTING', true);// this is basically used by the StashArray driver to decide if "isEnabled()" should return
  11. // true, since the Array driver is not meant for production use, just testing. We should not
  12. // use this anywhere else in the project since that would defeat the point of testing.
  13. define('TESTING_DIRECTORY', __DIR__);
  14. error_reporting(-1);
  15. date_default_timezone_set('UTC');
  16. $filename = __DIR__ .'/../vendor/autoload.php';
  17. if (!file_exists($filename)) {
  18. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" . PHP_EOL;
  19. echo " You need to execute `composer install` before running the tests. " . PHP_EOL;
  20. echo " Vendors are required for complete test execution. " . PHP_EOL;
  21. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" . PHP_EOL . PHP_EOL;
  22. $filename = __DIR__ .'/../autoload.php';
  23. }
  24. $loader = require $filename;
  25. $loader->addPsr4('Stash\\Test\\', __DIR__ . '/Stash/Test/');