From e803b5edb173cf91a4afd5f2ee6330e60426ffa8 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Mon, 31 Mar 2014 22:11:30 +0200 Subject: Remove test that has become unfit --- tests/codeigniter/core/Config_test.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php index 6a0a7a35f..9c39df71d 100644 --- a/tests/codeigniter/core/Config_test.php +++ b/tests/codeigniter/core/Config_test.php @@ -67,13 +67,6 @@ class Config_test extends CI_TestCase { // Clear base_url $this->ci_set_config('base_url', ''); - // Rerun constructor - $cls =& $this->ci_core_class('cfg'); - $this->config = new $cls; - - // Test default base - $this->assertEquals('http://localhost/', $this->config->base_url()); - // Capture server vars $old_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : NULL; $old_script = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL; @@ -87,6 +80,7 @@ class Config_test extends CI_TestCase { $_SERVER['SCRIPT_NAME'] = $path.$script; // Rerun constructor + $cls =& $this->ci_core_class('cfg'); $this->config = new $cls; // Test plain detected -- cgit v1.2.3-24-g4f1b From 3802d7006726451362c9ebd31302d8d6992dd4d5 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 1 Apr 2014 01:32:38 +0200 Subject: Add test for "base_url" determination on server root --- tests/codeigniter/core/Config_test.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php index 9c39df71d..81401e3ce 100644 --- a/tests/codeigniter/core/Config_test.php +++ b/tests/codeigniter/core/Config_test.php @@ -74,7 +74,7 @@ class Config_test extends CI_TestCase { // Setup server vars for detection $host = 'test.com'; - $path = '/path/'; + $path = '/'; $script = 'base_test.php'; $_SERVER['HTTP_HOST'] = $host; $_SERVER['SCRIPT_NAME'] = $path.$script; @@ -83,7 +83,15 @@ class Config_test extends CI_TestCase { $cls =& $this->ci_core_class('cfg'); $this->config = new $cls; - // Test plain detected + // Test plain detected (root) + $this->assertEquals('http://'.$host.$path, $this->config->base_url()); + + // Rerun constructor + $path = '/path/'; + $_SERVER['SCRIPT_NAME'] = $path.$script; + $this->config = new $cls; + + // Test plain detected (subfolder) $this->assertEquals('http://'.$host.$path, $this->config->base_url()); // Rerun constructor -- cgit v1.2.3-24-g4f1b From 7ead65b5dc48c477dc3dfe3b969b1e14bb9a1b79 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 1 Apr 2014 02:09:25 +0200 Subject: Discard the unwanted changes --- tests/codeigniter/core/Config_test.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php index 81401e3ce..2c28a639c 100644 --- a/tests/codeigniter/core/Config_test.php +++ b/tests/codeigniter/core/Config_test.php @@ -67,6 +67,13 @@ class Config_test extends CI_TestCase { // Clear base_url $this->ci_set_config('base_url', ''); + // Rerun constructor + $cls =& $this->ci_core_class('cfg'); + $this->config = new $cls; + + // Test default base + $this->assertEquals('http://localhost/', $this->config->base_url()); + // Capture server vars $old_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : NULL; $old_script = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL; @@ -80,7 +87,6 @@ class Config_test extends CI_TestCase { $_SERVER['SCRIPT_NAME'] = $path.$script; // Rerun constructor - $cls =& $this->ci_core_class('cfg'); $this->config = new $cls; // Test plain detected (root) -- cgit v1.2.3-24-g4f1b