Skip to content

Commit 3645ab3

Browse files
committed
Merge pull request bcit-ci#4125 from jim-parry/fix/lang_test
Improve CI_Lang tests
1 parent 84f24c2 commit 3645ab3

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

tests/codeigniter/core/Lang_test.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ public function test_load()
3434
$this->assertTrue($this->lang->load('email', 'german'));
3535
$this->assertEquals('german', $this->lang->is_loaded['email_lang.php']);
3636

37-
// Non-alpha idiom (should act the same as unspecified language)
38-
$this->ci_vfs_clone('system/language/english/number_lang.php');
39-
$this->assertTrue($this->lang->load('number'));
40-
$this->assertEquals('Bytes', $this->lang->language['bytes']);
41-
4237
// Non-existent file
4338
$this->setExpectedException(
4439
'RuntimeException',
@@ -49,6 +44,23 @@ public function test_load()
4944

5045
// --------------------------------------------------------------------
5146

47+
public function test_non_alpha_idiom()
48+
{
49+
// Non-alpha idiom (should act the same as unspecified language)
50+
// test with existing file
51+
$this->ci_vfs_clone('system/language/english/number_lang.php');
52+
$this->ci_vfs_clone('system/language/english/number_lang.php', 'system/language/123funny/');
53+
$this->assertTrue($this->lang->load('number', '123funny'));
54+
$this->assertEquals('Bytes', $this->lang->language['bytes']);
55+
56+
// test without existing file
57+
$this->ci_vfs_clone('system/language/english/email_lang.php');
58+
$this->assertTrue($this->lang->load('email', '456funny'));
59+
$this->assertEquals('You did not specify a SMTP hostname.', $this->lang->language['email_no_hostname']);
60+
}
61+
62+
// --------------------------------------------------------------------
63+
5264
public function test_multiple_file_load()
5365
{
5466
// Multiple files

0 commit comments

Comments
 (0)