summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core/Lang_test.php
diff options
context:
space:
mode:
authorMaster Yoda <jim_parry@bcit.ca>2015-09-21 07:16:06 +0200
committerMaster Yoda <jim_parry@bcit.ca>2015-09-21 07:16:06 +0200
commitb183fb897a30b95520aeb0613d933e85db441d3a (patch)
tree722579fe2d247af6e081476b1c7af9bd64cd1c5f /tests/codeigniter/core/Lang_test.php
parent882ab12a32c1c2ccef3e833c319b54eab7ee92ec (diff)
parentb6b401bcb134f7e99a9ea18e300c0af44d0685bf (diff)
Merge branch 'fix/lang_test' of https://github.com/jim-parry/CodeIgniter into fix/lang_test
Diffstat (limited to 'tests/codeigniter/core/Lang_test.php')
-rw-r--r--tests/codeigniter/core/Lang_test.php24
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));
}
+
}