-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap_phpunit.php
43 lines (32 loc) · 1.46 KB
/
bootstrap_phpunit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
// Load the PUPUnit Autoloader
include_once('PHPUnit/Autoload.php');
/**
* Set error reporting and display errors settings. You will want to change these when in production.
*/
error_reporting(E_ALL);
ini_set('display_errors', 1);
$app_path = trim($_SERVER['app_path'], '/').'/';
$package_path = trim($_SERVER['package_path'], '/').'/';
$core_path = trim($_SERVER['core_path'], '/').'/';
/**
* Website docroot
*/
define('DOCROOT', realpath(__DIR__.DIRECTORY_SEPARATOR.$_SERVER['doc_root']).DIRECTORY_SEPARATOR);
( ! is_dir($app_path) and is_dir(DOCROOT.$app_path)) and $app_path = DOCROOT.$app_path;
( ! is_dir($core_path) and is_dir(DOCROOT.$core_path)) and $core_path = DOCROOT.$core_path;
( ! is_dir($package_path) and is_dir(DOCROOT.$package_path)) and $package_path = DOCROOT.$package_path;
define('APPPATH', realpath($app_path).DIRECTORY_SEPARATOR);
define('PKGPATH', realpath($package_path).DIRECTORY_SEPARATOR);
define('COREPATH', realpath($core_path).DIRECTORY_SEPARATOR);
unset($app_path, $core_path, $package_path, $_SERVER['app_path'], $_SERVER['core_path'], $_SERVER['package_path']);
// Get the start time and memory for use later
defined('FUEL_START_TIME') or define('FUEL_START_TIME', microtime(true));
defined('FUEL_START_MEM') or define('FUEL_START_MEM', memory_get_usage());
// Boot the app
require_once APPPATH.'bootstrap.php';
// Set the environment to TEST
Fuel::$env = Fuel::TEST;
Fuel::$is_test = true;
// Import the TestCase class
import('testcase');