summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2014-04-01 01:32:38 +0200
committervlakoff <vlakoff@gmail.com>2014-04-01 01:32:38 +0200
commit3802d7006726451362c9ebd31302d8d6992dd4d5 (patch)
tree39b807492a4e3e1e9026c29e7c18e9f34c96e1a5
parentb208f6502917b42a07b4bb7e5ffe2ef4b1359267 (diff)
Add test for "base_url" determination on server root
-rw-r--r--tests/codeigniter/core/Config_test.php12
1 files changed, 10 insertions, 2 deletions
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