From 58743d7492234272d9a0cb14117415b461cd6e8b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 10 Oct 2014 17:04:10 +0300 Subject: Fix Config_test::test_base_url() --- tests/codeigniter/core/Config_test.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') 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; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b