summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/codeigniter/core/Config_test.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php
index 2c28a639c..8e312e361 100644
--- a/tests/codeigniter/core/Config_test.php
+++ b/tests/codeigniter/core/Config_test.php
@@ -76,7 +76,8 @@ class Config_test extends CI_TestCase {
// Capture server vars
$old_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : NULL;
- $old_script = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL;
+ $old_script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL;
+ $old_script_filename = $_SERVER['SCRIPT_FILENAME'];
$old_https = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : NULL;
// Setup server vars for detection
@@ -85,6 +86,7 @@ class Config_test extends CI_TestCase {
$script = 'base_test.php';
$_SERVER['HTTP_HOST'] = $host;
$_SERVER['SCRIPT_NAME'] = $path.$script;
+ $_SERVER['SCRIPT_FILENAME'] = '/foo/bar/'.$script;
// Rerun constructor
$this->config = new $cls;
@@ -95,6 +97,7 @@ class Config_test extends CI_TestCase {
// Rerun constructor
$path = '/path/';
$_SERVER['SCRIPT_NAME'] = $path.$script;
+ $_SERVER['SCRIPT_FILENAME'] = '/foo/bar/'.$path.$script;
$this->config = new $cls;
// Test plain detected (subfolder)
@@ -110,10 +113,12 @@ class Config_test extends CI_TestCase {
// Restore server vars
if ($old_host === NULL) unset($_SERVER['HTTP_HOST']);
else $_SERVER['HTTP_HOST'] = $old_host;
- if ($old_script === NULL) unset($_SERVER['SCRIPT_NAME']);
- else $_SERVER['SCRIPT_NAME'] = $old_script;
+ if ($old_script_name === NULL) unset($_SERVER['SCRIPT_NAME']);
+ else $_SERVER['SCRIPT_NAME'] = $old_script_name;
if ($old_https === NULL) unset($_SERVER['HTTPS']);
else $_SERVER['HTTPS'] = $old_https;
+
+ $_SERVER['SCRIPT_FILENAME'] = $old_script_filename;
}
// --------------------------------------------------------------------