diff options
Diffstat (limited to 'tests/codeigniter')
-rw-r--r-- | tests/codeigniter/core/Lang_test.php | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php index d2dd7598a..f8c12d884 100644 --- a/tests/codeigniter/core/Lang_test.php +++ b/tests/codeigniter/core/Lang_test.php @@ -41,14 +41,30 @@ class Lang_test extends CI_TestCase { // Non-existent file $this->setExpectedException( - 'RuntimeException', - 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php' + 'RuntimeException', 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php' ); $this->lang->load('nonexistent'); } // -------------------------------------------------------------------- + public function test_non_alpha_idiom() + { + // Non-alpha idiom (should act the same as unspecified language) + // test with existing file + $this->ci_vfs_clone('system/language/english/number_lang.php'); + $this->ci_vfs_clone('system/language/english/number_lang.php', 'system/language/123funny/'); + $this->assertTrue($this->lang->load('number', '123funny')); + $this->assertEquals('Bytes', $this->lang->language['bytes']); + + // test without existing file + $this->ci_vfs_clone('system/language/english/email_lang.php'); + $this->assertTrue($this->lang->load('email', '456funny')); + $this->assertEquals('Bytes', $this->lang->language['bytes']); + } + + // -------------------------------------------------------------------- + public function test_multiple_file_load() { // Multiple files @@ -58,8 +74,7 @@ class Lang_test extends CI_TestCase { 1 => 'nonexistent' ); $this->setExpectedException( - 'RuntimeException', - 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php' + 'RuntimeException', 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php' ); $this->lang->load($files, 'english'); } @@ -86,4 +101,5 @@ class Lang_test extends CI_TestCase { $this->assertFalse($this->lang->line('nonexistent_string')); $this->assertFalse($this->lang->line(NULL)); } + } |