blob: 38615dd892fe662fd7906c67707fe2f85b4e493a [file] [log] [blame]
Pascal Kriete69c97a72011-04-20 21:44:54 -04001<?php
2
Pascal Krietef5aee9d2011-04-21 01:20:40 -04003// Errors on full!
Pascal Kriete69c97a72011-04-20 21:44:54 -04004ini_set('display_errors', 1);
5error_reporting(E_ALL | E_STRICT);
6
Pascal Krietef5aee9d2011-04-21 01:20:40 -04007$dir = realpath(dirname(__FILE__));
Pascal Kriete69c97a72011-04-20 21:44:54 -04008
Pascal Krietef5aee9d2011-04-21 01:20:40 -04009// Path constants
10define('PROJECT_BASE', realpath($dir.'/../').'/');
Pascal Krietec5d93cb2011-04-21 00:58:51 -040011define('BASEPATH', PROJECT_BASE.'system/');
12define('APPPATH', PROJECT_BASE.'application/');
Taufan Aditya8749bc72012-03-11 05:43:45 +070013define('VIEWPATH', PROJECT_BASE.'');
Pascal Kriete69c97a72011-04-20 21:44:54 -040014
Taufan Adityae13511a2012-05-25 02:15:42 +070015// Get vfsStream either via PEAR or composer
Taufan Adityaeeca6d22012-05-25 03:15:19 +070016foreach (explode(PATH_SEPARATOR, get_include_path()) as $path)
Taufan Aditya6bca9f82012-05-25 01:55:36 +070017{
Taufan Aditya2d574452012-05-25 04:03:56 +070018 if (file_exists($path.DIRECTORY_SEPARATOR.'vfsStream/vfsStream.php'))
Taufan Adityaeeca6d22012-05-25 03:15:19 +070019 {
20 require_once 'vfsStream/vfsStream.php';
21 break;
22 }
Taufan Aditya6bca9f82012-05-25 01:55:36 +070023}
Taufan Adityaeeca6d22012-05-25 03:15:19 +070024
25if ( ! class_exists('vfsStream') && file_exists(PROJECT_BASE.'vendor/autoload.php'))
Taufan Aditya6bca9f82012-05-25 01:55:36 +070026{
Taufan Adityae13511a2012-05-25 02:15:42 +070027 include_once PROJECT_BASE.'vendor/autoload.php';
28 class_alias('org\bovigo\vfs\vfsStream', 'vfsStream');
29 class_alias('org\bovigo\vfs\vfsStreamDirectory', 'vfsStreamDirectory');
30 class_alias('org\bovigo\vfs\vfsStreamWrapper', 'vfsStreamWrapper');
Taufan Aditya6bca9f82012-05-25 01:55:36 +070031}
32
Pascal Krietef5aee9d2011-04-21 01:20:40 -040033// Prep our test environment
Taufan Adityaca16c4f2012-03-28 15:15:30 +070034include_once $dir.'/mocks/core/common.php';
35include_once $dir.'/mocks/autoloader.php';
36spl_autoload_register('autoload');
Pascal Krietef5aee9d2011-04-21 01:20:40 -040037
38unset($dir);