From 3645ab3fce68789b9b7884f4c22696013f6f51a2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 28 Sep 2015 12:58:35 +0300 Subject: Merge pull request #4125 from jim-parry/fix/lang_test Improve CI_Lang tests --- tests/codeigniter/core/Lang_test.php | 22 +++++++++++++++++----- 1 file 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 -- cgit v1.2.3-24-g4f1b