diff options
author | Andrey Andreev <narf@devilix.net> | 2014-10-10 16:04:10 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-10-10 16:04:10 +0200 |
commit | 58743d7492234272d9a0cb14117415b461cd6e8b (patch) | |
tree | 60bc0ac99494b400f9cb2db4ba9f1ad50469ba25 /tests/codeigniter/core | |
parent | f35ae5eb7fc81b1c6a903591c6ff56103e6e247f (diff) |
Fix Config_test::test_base_url()
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r-- | tests/codeigniter/core/Config_test.php | 11 |
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; } // -------------------------------------------------------------------- |