diff options
author | Jonatas Miguel <jonatas.df.miguel@gmail.com> | 2012-10-31 15:44:02 +0100 |
---|---|---|
committer | Jonatas Miguel <jonatas.df.miguel@gmail.com> | 2012-10-31 15:44:02 +0100 |
commit | 3ccc386be4e0e1e4b3d47f1785e11d4b8613ef72 (patch) | |
tree | f1c8cd29775537b8da76143edeec5b6c8d659550 /tests/codeigniter/core | |
parent | a9a1d2520493211ca35f7ab56866d0e154afc1c3 (diff) | |
parent | f2b19fee7876708c7a7bb5cba6b7df682a9d2a53 (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r-- | tests/codeigniter/core/Common_test.php | 18 | ||||
-rw-r--r-- | tests/codeigniter/core/Config_test.php | 25 | ||||
-rw-r--r-- | tests/codeigniter/core/Loader_test.php | 4 |
3 files changed, 17 insertions, 30 deletions
diff --git a/tests/codeigniter/core/Common_test.php b/tests/codeigniter/core/Common_test.php index 27d48efc2..999b49cb3 100644 --- a/tests/codeigniter/core/Common_test.php +++ b/tests/codeigniter/core/Common_test.php @@ -2,8 +2,6 @@ class Common_test extends CI_TestCase { - // ------------------------------------------------------------------------ - public function test_is_php() { $this->assertEquals(TRUE, is_php('1.2.0')); @@ -16,12 +14,12 @@ class Common_test extends CI_TestCase { { $this->assertEquals(' class="foo" id="bar"', _stringify_attributes(array('class' => 'foo', 'id' => 'bar'))); - $atts = new Stdclass; + $atts = new stdClass; $atts->class = 'foo'; $atts->id = 'bar'; $this->assertEquals(' class="foo" id="bar"', _stringify_attributes($atts)); - $atts = new Stdclass; + $atts = new stdClass; $this->assertEquals('', _stringify_attributes($atts)); $this->assertEquals(' class="foo" id="bar"', _stringify_attributes('class="foo" id="bar"')); @@ -35,10 +33,20 @@ class Common_test extends CI_TestCase { { $this->assertEquals('width=800,height=600', _stringify_attributes(array('width' => '800', 'height' => '600'), TRUE)); - $atts = new Stdclass; + $atts = new stdClass; $atts->width = 800; $atts->height = 600; $this->assertEquals('width=800,height=600', _stringify_attributes($atts, TRUE)); } + // ------------------------------------------------------------------------ + + public function test_html_escape() + { + $this->assertEquals( + html_escape('Here is a string containing "quoted" text.'), + 'Here is a string containing "quoted" text.' + ); + } + }
\ No newline at end of file diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php index d652a625e..be426d070 100644 --- a/tests/codeigniter/core/Config_test.php +++ b/tests/codeigniter/core/Config_test.php @@ -9,7 +9,7 @@ class Config_test extends CI_TestCase { // set predictable config values $this->cfg = array( 'index_page' => 'index.php', - 'base_url' => 'http://example.com/', + 'base_url' => 'http://example.com/', 'subclass_prefix' => 'MY_' ); $this->ci_set_config($this->cfg); @@ -38,7 +38,6 @@ class Config_test extends CI_TestCase { $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')); } @@ -50,7 +49,6 @@ class Config_test extends CI_TestCase { $this->assertFalse($this->config->slash_item('no_good_item')); $this->assertEquals($this->cfg['base_url'], $this->config->slash_item('base_url')); - $this->assertEquals($this->cfg['subclass_prefix'].'/', $this->config->slash_item('subclass_prefix')); } @@ -124,7 +122,7 @@ class Config_test extends CI_TestCase { $q_string = $this->config->item('enable_query_strings'); $this->config->set_item('enable_query_strings', FALSE); - $uri= 'test'; + $uri = 'test'; $uri2 = '1'; $this->assertEquals($index_page.'/'.$uri, $this->config->site_url($uri)); $this->assertEquals($index_page.'/'.$uri.'/'.$uri2, $this->config->site_url(array($uri, $uri2))); @@ -137,7 +135,6 @@ class Config_test extends CI_TestCase { $this->assertEquals($index_page.'/'.$uri.$suffix.'?'.$arg, $this->config->site_url($uri.'?'.$arg)); $this->config->set_item('url_suffix', FALSE); - $this->config->set_item('enable_query_strings', TRUE); $this->assertEquals($index_page.'?'.$uri, $this->config->site_url($uri)); @@ -233,22 +230,4 @@ class Config_test extends CI_TestCase { $this->assertNull($this->config->load($file)); } - // -------------------------------------------------------------------- - - public function test_assign_to_config() - { - $key1 = 'test'; - $key2 = '1'; - $val1 = 'foo'; - $val2 = 'bar'; - $cfg = array( - $key1 => $val1, - $key2 => $val2 - ); - - $this->assertNull($this->config->_assign_to_config($cfg)); - $this->assertEquals($val1, $this->config->item($key1)); - $this->assertEquals($val2, $this->config->item($key2)); - } - }
\ No newline at end of file diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php index f7c338a20..816587a49 100644 --- a/tests/codeigniter/core/Loader_test.php +++ b/tests/codeigniter/core/Loader_test.php @@ -36,7 +36,7 @@ class Loader_test extends CI_TestCase { $this->assertAttributeInstanceOf($class, $lib, $this->ci_obj); // Test no lib given - $this->assertFalse($this->load->library()); + $this->assertNull($this->load->library()); // Test a string given to params $this->assertNull($this->load->library($lib, ' ')); @@ -450,7 +450,7 @@ class Loader_test extends CI_TestCase { public function test_load_config() { $cfg = 'someconfig'; - $this->assertNull($this->load->config($cfg, FALSE)); + $this->assertTrue($this->load->config($cfg, FALSE)); $this->assertContains($cfg, $this->ci_obj->config->loaded); } |