From db669f1de59f7105e0b9cf39899b98fd75b90771 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 21 Jan 2015 16:51:51 +0200 Subject: Make libraries matching controller names loadable --- tests/codeigniter/core/Loader_test.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/codeigniter/core/Loader_test.php') diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php index 93ca5b223..9e2092e05 100644 --- a/tests/codeigniter/core/Loader_test.php +++ b/tests/codeigniter/core/Loader_test.php @@ -405,12 +405,19 @@ class Loader_test extends CI_TestCase { // Create model in VFS package path $dir = 'third-party'; $lib = 'unit_test_package'; - $class = 'CI_'.ucfirst($lib); + $class = ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), 'ci_app_root, array($dir, 'libraries')); // Get paths $paths = $this->load->get_package_paths(TRUE); + // Test failed load without path + $this->setExpectedException( + 'RuntimeException', + 'CI Error: Unable to load the requested class: '.ucfirst($lib) + ); + $this->load->library($lib); + // Add path and verify $path = APPPATH.$dir.'/'; $this->assertInstanceOf('CI_Loader', $this->load->add_package_path($path)); @@ -432,13 +439,6 @@ class Loader_test extends CI_TestCase { // Remove path and verify restored paths $this->assertInstanceOf('CI_Loader', $this->load->remove_package_path($path)); $this->assertEquals($paths, $this->load->get_package_paths(TRUE)); - - // Test failed load without path - $this->setExpectedException( - 'RuntimeException', - 'CI Error: Unable to load the requested class: '.ucfirst($lib) - ); - $this->load->library($lib); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b