2016-10-27 23:53:11 +02:00
|
|
|
<?php
|
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
if (!defined('BASE_PATH')) {
|
|
|
|
echo "BASE_PATH hasn't been defined. This probably means that framework/Core/Constants.php hasn't been " .
|
|
|
|
"included by Composer's autoloader.\n" .
|
|
|
|
"Make sure the you are running your tests via vendor/bin/phpunit and your autoloader is up to date.\n";
|
|
|
|
exit(1);
|
2016-10-27 23:53:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This bootstraps the SilverStripe system so that phpunit can be run directly on SilverStripe tests.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Make sure display_errors is on
|
|
|
|
ini_set('display_errors', 1);
|
|
|
|
|
|
|
|
// Asset folder
|
2016-12-16 05:34:21 +01:00
|
|
|
if (!file_exists(BASE_PATH . '/assets')) {
|
|
|
|
mkdir(BASE_PATH . '/assets', 02775);
|
2016-10-27 23:53:11 +02:00
|
|
|
}
|
2016-11-01 21:11:35 +01:00
|
|
|
|
|
|
|
if (empty($_SERVER['HTTP_HOST'])) {
|
2016-12-16 05:34:21 +01:00
|
|
|
$_SERVER['HTTP_HOST'] = 'localhost';
|
2016-11-01 21:11:35 +01:00
|
|
|
}
|