diff options
Diffstat (limited to 'tests/codeigniter')
-rw-r--r-- | tests/codeigniter/core/Config_test.php | 13 | ||||
-rw-r--r-- | tests/codeigniter/core/Lang_test.php | 7 | ||||
-rw-r--r-- | tests/codeigniter/core/Output_test.php | 10 | ||||
-rw-r--r-- | tests/codeigniter/core/URI_test.php | 23 |
4 files changed, 20 insertions, 33 deletions
diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php index 8e312e361..f125fc6e9 100644 --- a/tests/codeigniter/core/Config_test.php +++ b/tests/codeigniter/core/Config_test.php @@ -205,13 +205,18 @@ class Config_test extends CI_TestCase { 'number' => 42, 'letter' => 'Z' ); + $pkg_dir = 'package'; - $this->ci_vfs_create($file.'.php', '<?php $config = '.var_export($cfg2, TRUE).';', $this->ci_app_root, - array($pkg_dir, 'config')); - $this->config->_config_paths[] = $this->ci_vfs_path($pkg_dir.'/', APPPATH); + $this->ci_vfs_create( + $file.'.php', + '<?php $config = '.var_export($cfg2, TRUE).';', + $this->ci_app_root, + array($pkg_dir, 'config') + ); + array_unshift($this->config->_config_paths, $this->ci_vfs_path($pkg_dir.'/', APPPATH)); $this->assertTrue($this->config->load($file, TRUE)); $this->assertEquals(array_merge($cfg, $cfg2), $this->config->item($file)); - array_pop($this->config->_config_paths); + array_shift($this->config->_config_paths); // Test graceful fail of invalid file $file = 'badfile'; diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php index d3c7ee1e4..87a71c885 100644 --- a/tests/codeigniter/core/Lang_test.php +++ b/tests/codeigniter/core/Lang_test.php @@ -29,6 +29,11 @@ class Lang_test extends CI_TestCase { $this->assertTrue($this->lang->load('date')); $this->assertEquals('Year', $this->lang->language['date_year']); + // A language other than english + $this->ci_vfs_clone('system/language/english/email_lang.php', 'system/language/german/'); + $this->assertTrue($this->lang->load('email', 'german')); + $this->assertEquals('german', $this->lang->is_loaded['email_lang.php'] ); + // Non-alpha idiom (should act the same as unspecified language) $this->ci_vfs_clone('system/language/english/number_lang.php'); $this->assertTrue($this->lang->load('number')); @@ -56,4 +61,4 @@ class Lang_test extends CI_TestCase { $this->assertFalse($this->lang->line(NULL)); } -}
\ No newline at end of file +} diff --git a/tests/codeigniter/core/Output_test.php b/tests/codeigniter/core/Output_test.php index 0eeb93f7b..a06c17045 100644 --- a/tests/codeigniter/core/Output_test.php +++ b/tests/codeigniter/core/Output_test.php @@ -38,16 +38,6 @@ HTML; // -------------------------------------------------------------------- - public function test_minify() - { - $this->assertEquals( - str_replace(array("\t", "\n"), '', $this->_output_data), - $this->output->minify($this->_output_data) - ); - } - - // -------------------------------------------------------------------- - public function test_get_content_type() { $this->assertEquals('text/html', $this->output->get_content_type()); diff --git a/tests/codeigniter/core/URI_test.php b/tests/codeigniter/core/URI_test.php index b05a385d6..50663d54a 100644 --- a/tests/codeigniter/core/URI_test.php +++ b/tests/codeigniter/core/URI_test.php @@ -119,26 +119,12 @@ class URI_test extends CI_TestCase { */ // -------------------------------------------------------------------- - public function test_filter_uri() + public function test_filter_uri_passing() { $this->uri->_set_permitted_uri_chars('a-z 0-9~%.:_\-'); - $str_in = 'abc01239~%.:_-'; - $str = $this->uri->filter_uri($str_in); - - $this->assertEquals($str, $str_in); - } - - // -------------------------------------------------------------------- - - public function test_filter_uri_escaping() - { - // ensure escaping even if dodgey characters are permitted - $this->uri->_set_permitted_uri_chars('a-z 0-9~%.:_\-()$'); - - $str = $this->uri->filter_uri('$destroy_app(foo)'); - - $this->assertEquals($str, '$destroy_app(foo)'); + $str = 'abc01239~%.:_-'; + $this->uri->filter_uri($str); } // -------------------------------------------------------------------- @@ -149,7 +135,8 @@ class URI_test extends CI_TestCase { $this->uri->config->set_item('enable_query_strings', FALSE); $this->uri->_set_permitted_uri_chars('a-z 0-9~%.:_\-'); - $this->uri->filter_uri('$this()'); + $segment = '$this()'; // filter_uri() accepts by reference + $this->uri->filter_uri($segment); } // -------------------------------------------------------------------- |