From 7ca540ea3245a68c43401e4aaab0a391c85a8772 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 23 Oct 2015 06:10:30 +0900 Subject: [PATCH] Add test for autoloading library in sub directory --- application/config/autoload.php | 2 +- application/controllers/Ci_autoload_library.php | 9 +++++++++ application/libraries/subdir/Baz.php | 9 +++++++++ .../tests/controllers/Ci_autoload_library_test.php | 10 ++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 application/controllers/Ci_autoload_library.php create mode 100644 application/libraries/subdir/Baz.php create mode 100644 application/tests/controllers/Ci_autoload_library_test.php diff --git a/application/config/autoload.php b/application/config/autoload.php index 866b477..6e2e36e 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -60,7 +60,7 @@ | $autoload['libraries'] = array('user_agent' => 'ua'); */ -$autoload['libraries'] = array('session', 'form_validation'); +$autoload['libraries'] = array('session', 'form_validation', 'subdir/baz'); /* diff --git a/application/controllers/Ci_autoload_library.php b/application/controllers/Ci_autoload_library.php new file mode 100644 index 0000000..208b097 --- /dev/null +++ b/application/controllers/Ci_autoload_library.php @@ -0,0 +1,9 @@ +baz->doSomething(); + } +} diff --git a/application/libraries/subdir/Baz.php b/application/libraries/subdir/Baz.php new file mode 100644 index 0000000..ecd9d78 --- /dev/null +++ b/application/libraries/subdir/Baz.php @@ -0,0 +1,9 @@ +request('GET', 'ci_autoload_library/subdir'); + $this->assertEquals('Baz something', $output); + } +}