2016-10-27 23:53:11 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Bootstrap for running SapphireTests
|
|
|
|
|
|
|
|
// Connect to database
|
|
|
|
use SilverStripe\ORM\DB;
|
|
|
|
|
2016-11-01 04:13:06 +01:00
|
|
|
require_once __DIR__ . '/../../src/Core/Core.php';
|
2016-10-14 03:30:05 +02:00
|
|
|
require_once __DIR__ . '/../php/Control/FakeController.php';
|
2016-10-27 23:53:11 +02:00
|
|
|
|
2017-04-11 03:31:58 +02:00
|
|
|
// Bootstrap a mock project configuration
|
|
|
|
require __DIR__ . '/mysite.php';
|
|
|
|
|
2016-10-27 23:53:11 +02:00
|
|
|
global $databaseConfig;
|
|
|
|
DB::connect($databaseConfig);
|
|
|
|
|
|
|
|
// Now set a fake REQUEST_URI
|
|
|
|
$_SERVER['REQUEST_URI'] = BASE_URL;
|
|
|
|
|
|
|
|
// Fake a session
|
|
|
|
$_SESSION = null;
|
|
|
|
|
|
|
|
// Remove the error handler so that PHPUnit can add its own
|
|
|
|
restore_error_handler();
|