summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-09-28 11:58:35 +0200
committerAndrey Andreev <narf@devilix.net>2015-09-28 12:01:36 +0200
commit3645ab3fce68789b9b7884f4c22696013f6f51a2 (patch)
tree9f3e26a1cb233c52c2e139a8b0118a04f73b36e6 /tests
parent84f24c23baf5ea45c30c4ab3cbc57cd846ea0f56 (diff)
Merge pull request #4125 from jim-parry/fix/lang_test
Improve CI_Lang tests
Diffstat (limited to 'tests')
-rw-r--r--tests/codeigniter/core/Lang_test.php22
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