From cbc21b9bdbaeb2defd47c0808d47801ab1a14ede Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Sun, 29 Mar 2015 13:59:16 -0400 Subject: Increased code coverage Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Lang_test.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'tests/codeigniter/core/Lang_test.php') diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php index 929bc2ffd..3c1e19db3 100644 --- a/tests/codeigniter/core/Lang_test.php +++ b/tests/codeigniter/core/Lang_test.php @@ -38,7 +38,7 @@ class Lang_test extends CI_TestCase { $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', @@ -46,7 +46,30 @@ class Lang_test extends CI_TestCase { ); $this->lang->load('nonexistent'); } + + // -------------------------------------------------------------------- + + public function test_multiple_file_load() + { + // Multiple files + $this->ci_vfs_clone('system/language/english/profiler_lang.php'); + $files = Array('profiler', 'nonexistent'); + $this->setExpectedException( + 'RuntimeException', + 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php' + ); + $this->assertTrue($this->lang->load($files, 'english')); + } + // -------------------------------------------------------------------- + + public function test_alternative_path_load() + { + // Alternative Path + $this->ci_vfs_clone('system/language/english/profiler_lang.php'); + $this->assertTrue($this->lang->load('profiler', 'english', FALSE, TRUE, 'vfs://system/')); + } + // -------------------------------------------------------------------- /** -- cgit v1.2.3-24-g4f1b From 4924115bdf8042850e7934d0ab66fe451e7c778b Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Sun, 29 Mar 2015 15:10:16 -0400 Subject: removed space Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Lang_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/codeigniter/core/Lang_test.php') diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php index 3c1e19db3..a4db7a9c2 100644 --- a/tests/codeigniter/core/Lang_test.php +++ b/tests/codeigniter/core/Lang_test.php @@ -38,7 +38,7 @@ class Lang_test extends CI_TestCase { $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', -- cgit v1.2.3-24-g4f1b From d1f39fdef53fc510a6a5d19ec2991e5bc474bc29 Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Mon, 30 Mar 2015 10:11:32 -0400 Subject: updated array style and removed assert true Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Lang_test.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/codeigniter/core/Lang_test.php') diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php index a4db7a9c2..3fccf096d 100644 --- a/tests/codeigniter/core/Lang_test.php +++ b/tests/codeigniter/core/Lang_test.php @@ -53,12 +53,15 @@ class Lang_test extends CI_TestCase { { // Multiple files $this->ci_vfs_clone('system/language/english/profiler_lang.php'); - $files = Array('profiler', 'nonexistent'); + $files = Array( + 0 => 'profiler', + 1 => 'nonexistent' + ); $this->setExpectedException( 'RuntimeException', 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php' ); - $this->assertTrue($this->lang->load($files, 'english')); + $this->lang->load($files, 'english'); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From fc67a701a574641b5dfd7afe00d4c5d403111626 Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Mon, 30 Mar 2015 12:08:11 -0400 Subject: changed to lowercase array and space. Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Lang_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/codeigniter/core/Lang_test.php') diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php index 3fccf096d..0f6ffd3fa 100644 --- a/tests/codeigniter/core/Lang_test.php +++ b/tests/codeigniter/core/Lang_test.php @@ -53,9 +53,9 @@ class Lang_test extends CI_TestCase { { // Multiple files $this->ci_vfs_clone('system/language/english/profiler_lang.php'); - $files = Array( - 0 => 'profiler', - 1 => 'nonexistent' + $files = array( + 0 => 'profiler', + 1 => 'nonexistent' ); $this->setExpectedException( 'RuntimeException', -- cgit v1.2.3-24-g4f1b