summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core/Config_test.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-09 22:16:58 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-09 22:16:58 +0200
commitc186288755aba46a2b6f0c3f104d9a6ce6b11a7f (patch)
tree1858ae3cb82693e30e2682b2d6e24aecfd959ff7 /tests/codeigniter/core/Config_test.php
parent99b782d8a3d92c4703a059cbd62e2f1e6fea689c (diff)
Cleanup/optimize tests/codeigniter/
Diffstat (limited to 'tests/codeigniter/core/Config_test.php')
-rw-r--r--tests/codeigniter/core/Config_test.php38
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php
index 30f0cc61d..30cb90a28 100644
--- a/tests/codeigniter/core/Config_test.php
+++ b/tests/codeigniter/core/Config_test.php
@@ -5,7 +5,7 @@ class Config_test extends CI_TestCase {
public function set_up()
{
$cls =& $this->ci_core_class('cfg');
-
+
// set predictable config values
$this->ci_set_config(array(
'index_page' => 'index.php',
@@ -13,9 +13,9 @@ class Config_test extends CI_TestCase {
'subclass_prefix' => 'MY_'
));
- $this->config = new $cls;
+ $this->config = new $cls;
}
-
+
// --------------------------------------------------------------------
public function test_item()
@@ -24,30 +24,30 @@ class Config_test extends CI_TestCase {
// Bad Config value
$this->assertFalse($this->config->item('no_good_item'));
-
+
// Index
$this->assertFalse($this->config->item('no_good_item', 'bad_index'));
$this->assertFalse($this->config->item('no_good_item', 'default'));
}
-
+
// --------------------------------------------------------------------
-
+
public function test_set_item()
{
$this->assertFalse($this->config->item('not_yet_set'));
-
+
$this->config->set_item('not_yet_set', 'is set');
-
+
$this->assertEquals('is set', $this->config->item('not_yet_set'));
}
// --------------------------------------------------------------------
-
+
public function test_slash_item()
{
// Bad Config value
$this->assertFalse($this->config->slash_item('no_good_item'));
-
+
$this->assertEquals('http://example.com/', $this->config->slash_item('base_url'));
$this->assertEquals('MY_/', $this->config->slash_item('subclass_prefix'));
@@ -58,33 +58,33 @@ class Config_test extends CI_TestCase {
public function test_site_url()
{
$this->assertEquals('http://example.com/index.php', $this->config->site_url());
-
+
$base_url = $this->config->item('base_url');
-
+
$this->config->set_item('base_url', '');
-
+
$q_string = $this->config->item('enable_query_strings');
-
+
$this->config->set_item('enable_query_strings', FALSE);
$this->assertEquals('index.php/test', $this->config->site_url('test'));
$this->assertEquals('index.php/test/1', $this->config->site_url(array('test', '1')));
-
+
$this->config->set_item('enable_query_strings', TRUE);
$this->assertEquals('index.php?test', $this->config->site_url('test'));
$this->assertEquals('index.php?0=test&1=1', $this->config->site_url(array('test', '1')));
-
+
$this->config->set_item('base_url', $base_url);
$this->assertEquals('http://example.com/index.php?test', $this->config->site_url('test'));
-
+
// back to home base
- $this->config->set_item('enable_query_strings', $q_string);
+ $this->config->set_item('enable_query_strings', $q_string);
}
// --------------------------------------------------------------------
-
+
public function test_system_url()
{
$this->assertEquals('http://example.com/system/', $this->config->system_url());