diff options
author | Andrey Andreev <narf@devilix.net> | 2015-09-28 11:58:35 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-09-28 11:58:35 +0200 |
commit | 27c2e941b4eecb844ed7fd5dee9168e6f4359f2a (patch) | |
tree | 2211bed343f50c834a5b8f547c62414be17e886b | |
parent | 5703f50fea1577fdc6de1d5c6a7c99b65488951b (diff) | |
parent | ddb80e7402697b6ca995f31810ad9e1c8f380b81 (diff) |
Merge pull request #4125 from jim-parry/fix/lang_test
Improve CI_Lang tests
-rw-r--r-- | tests/codeigniter/core/Lang_test.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php index d2dd7598a..4958f42e1 100644 --- a/tests/codeigniter/core/Lang_test.php +++ b/tests/codeigniter/core/Lang_test.php @@ -34,11 +34,6 @@ class Lang_test extends CI_TestCase { $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')); - $this->assertEquals('Bytes', $this->lang->language['bytes']); - // Non-existent file $this->setExpectedException( 'RuntimeException', @@ -49,6 +44,23 @@ class Lang_test extends CI_TestCase { // -------------------------------------------------------------------- + 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('You did not specify a SMTP hostname.', $this->lang->language['email_no_hostname']); + } + + // -------------------------------------------------------------------- + public function test_multiple_file_load() { // Multiple files |