Pascal Kriete | 69c97a7 | 2011-04-20 21:44:54 -0400 | [diff] [blame] | 1 | <?php |
| 2 | |
Pascal Kriete | f5aee9d | 2011-04-21 01:20:40 -0400 | [diff] [blame] | 3 | // Errors on full! |
Pascal Kriete | 69c97a7 | 2011-04-20 21:44:54 -0400 | [diff] [blame] | 4 | ini_set('display_errors', 1); |
| 5 | error_reporting(E_ALL | E_STRICT); |
| 6 | |
Pascal Kriete | f5aee9d | 2011-04-21 01:20:40 -0400 | [diff] [blame] | 7 | $dir = realpath(dirname(__FILE__)); |
Pascal Kriete | 69c97a7 | 2011-04-20 21:44:54 -0400 | [diff] [blame] | 8 | |
Pascal Kriete | f5aee9d | 2011-04-21 01:20:40 -0400 | [diff] [blame] | 9 | // Path constants |
| 10 | define('PROJECT_BASE', realpath($dir.'/../').'/'); |
Pascal Kriete | c5d93cb | 2011-04-21 00:58:51 -0400 | [diff] [blame] | 11 | define('BASEPATH', PROJECT_BASE.'system/'); |
| 12 | define('APPPATH', PROJECT_BASE.'application/'); |
Taufan Aditya | 8749bc7 | 2012-03-11 05:43:45 +0700 | [diff] [blame] | 13 | define('VIEWPATH', PROJECT_BASE.''); |
Pascal Kriete | 69c97a7 | 2011-04-20 21:44:54 -0400 | [diff] [blame] | 14 | |
Taufan Aditya | e13511a | 2012-05-25 02:15:42 +0700 | [diff] [blame^] | 15 | // Get vfsStream either via PEAR or composer |
Taufan Aditya | 6bca9f8 | 2012-05-25 01:55:36 +0700 | [diff] [blame] | 16 | if (file_exists('vfsStream/vfsStream.php')) |
| 17 | { |
| 18 | require_once 'vfsStream/vfsStream.php'; |
| 19 | } |
| 20 | else |
| 21 | { |
Taufan Aditya | e13511a | 2012-05-25 02:15:42 +0700 | [diff] [blame^] | 22 | include_once PROJECT_BASE.'vendor/autoload.php'; |
| 23 | class_alias('org\bovigo\vfs\vfsStream', 'vfsStream'); |
| 24 | class_alias('org\bovigo\vfs\vfsStreamDirectory', 'vfsStreamDirectory'); |
| 25 | class_alias('org\bovigo\vfs\vfsStreamWrapper', 'vfsStreamWrapper'); |
Taufan Aditya | 6bca9f8 | 2012-05-25 01:55:36 +0700 | [diff] [blame] | 26 | } |
| 27 | |
Pascal Kriete | f5aee9d | 2011-04-21 01:20:40 -0400 | [diff] [blame] | 28 | // Prep our test environment |
Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 29 | include_once $dir.'/mocks/core/common.php'; |
| 30 | include_once $dir.'/mocks/autoloader.php'; |
| 31 | spl_autoload_register('autoload'); |
Pascal Kriete | f5aee9d | 2011-04-21 01:20:40 -0400 | [diff] [blame] | 32 | |
| 33 | unset($dir); |