From 580fe8ec482f5df7ca5b91e11b13b72a8f3ed0b8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 9 Oct 2012 13:27:50 +0300 Subject: Set REMOTE_ADDR in tests --- tests/Bootstrap.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/Bootstrap.php') diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 5216038c6..1c666d503 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -11,6 +11,7 @@ defined('PROJECT_BASE') OR define('PROJECT_BASE', realpath($dir.'/../').'/'); defined('BASEPATH') OR define('BASEPATH', PROJECT_BASE.'system/'); defined('APPPATH') OR define('APPPATH', PROJECT_BASE.'application/'); defined('VIEWPATH') OR define('VIEWPATH', PROJECT_BASE.''); +isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; // Get vfsStream either via PEAR or composer foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) -- cgit v1.2.3-24-g4f1b From 7ecc5cda6647a4b316b44dc40d5925d9ef63c908 Mon Sep 17 00:00:00 2001 From: dchill42 Date: Fri, 12 Oct 2012 16:25:51 -0400 Subject: Integrated vfsStream better and made paths constants VFS-based Signed-off-by: dchill42 --- tests/Bootstrap.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'tests/Bootstrap.php') diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 1c666d503..ea8d8aea8 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -8,10 +8,7 @@ $dir = realpath(dirname(__FILE__)); // Path constants defined('PROJECT_BASE') OR define('PROJECT_BASE', realpath($dir.'/../').'/'); -defined('BASEPATH') OR define('BASEPATH', PROJECT_BASE.'system/'); -defined('APPPATH') OR define('APPPATH', PROJECT_BASE.'application/'); -defined('VIEWPATH') OR define('VIEWPATH', PROJECT_BASE.''); -isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; +defined('SYSTEM_PATH') OR define('SYSTEM_PATH', PROJECT_BASE.'system/'); // Get vfsStream either via PEAR or composer foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) @@ -31,8 +28,17 @@ if ( ! class_exists('vfsStream') && file_exists(PROJECT_BASE.'vendor/autoload.ph class_alias('org\bovigo\vfs\vfsStreamWrapper', 'vfsStreamWrapper'); } +// Define CI path constants to VFS (filesystem setup in CI_TestCase::setUp) +defined('BASEPATH') OR define('BASEPATH', vfsStream::url('system/')); +defined('APPPATH') OR define('APPPATH', vfsStream::url('application/')); +defined('VIEWPATH') OR define('VIEWPATH', APPPATH.'views/'); + +// Set localhost "remote" IP +isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; + // Prep our test environment include_once $dir.'/mocks/core/common.php'; +include_once SYSTEM_PATH.'core/common.php'; include_once $dir.'/mocks/autoloader.php'; spl_autoload_register('autoload'); -- cgit v1.2.3-24-g4f1b From e9435dc7e5a4a9779eb83d8adf172fabf47ab5a6 Mon Sep 17 00:00:00 2001 From: dchill42 Date: Sun, 14 Oct 2012 15:44:39 -0400 Subject: Adapted DB for VFS changes and fixed Common case in Bootstrap.php Signed-off-by: dchill42 --- tests/Bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/Bootstrap.php') diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index ea8d8aea8..8ce80b3fd 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -38,7 +38,7 @@ isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; // Prep our test environment include_once $dir.'/mocks/core/common.php'; -include_once SYSTEM_PATH.'core/common.php'; +include_once SYSTEM_PATH.'core/Common.php'; include_once $dir.'/mocks/autoloader.php'; spl_autoload_register('autoload'); -- cgit v1.2.3-24-g4f1b