forked from projek-xyz/ci-startapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
44 lines (37 loc) · 1.18 KB
/
bootstrap.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
44
<?php
/*
*---------------------------------------------------------------
* OVERRIDE FUNCTIONS
*---------------------------------------------------------------
*
* This will "override" later functions meant to be defined
* in core\Common.php, so they throw errors instead of output strings
*/
function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered')
{
throw new PHPUnit_Framework_Exception($message, $status_code);
}
function show_404($page = '', $log_error = TRUE)
{
throw new PHPUnit_Framework_Exception($page, 404);
}
/**
* Override default CI CLI argument parser
* This avoid hardcode overriding core\URI.php file
*/
$_SERVER['argv'] = [];
/*
*---------------------------------------------------------------
* BOOTSTRAP
*---------------------------------------------------------------
*
* Bootstrap CodeIgniter from index.php as usual
*/
require_once __DIR__.'/../public/index.php';
/*
*---------------------------------------------------------------
* Abstract Test Cases
*---------------------------------------------------------------
*/
require_once __DIR__.'/units/CI_TestCase.php';
// require_once __DIR__.'/units/CI_DB_TestCase.php';