summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core/Loader_test.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-03-28 12:13:52 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-03-28 12:13:52 +0200
commitc8ab5738c920f0daec0af184dbb2f744c3ca9611 (patch)
treead74003a1a758f4c5638f06687f2ee60e534e941 /tests/codeigniter/core/Loader_test.php
parenta11b16b1af42bbb4ffbc15eeee50a3d3ceb402d5 (diff)
parentbdb84af43792f507eaab5ab0c4b3ec1be17a1a54 (diff)
Merge pull request #1226 from toopay/unit-tests
Improve Unit tests
Diffstat (limited to 'tests/codeigniter/core/Loader_test.php')
-rw-r--r--tests/codeigniter/core/Loader_test.php38
1 files changed, 1 insertions, 37 deletions
diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php
index b86fd3477..43008651e 100644
--- a/tests/codeigniter/core/Loader_test.php
+++ b/tests/codeigniter/core/Loader_test.php
@@ -1,38 +1,5 @@
<?php
-require_once 'vfsStream/vfsStream.php';
-require_once BASEPATH.'/core/Loader.php';
-
-class Extended_Loader extends CI_Loader {
-
- /**
- * Since we use paths to load up models, views, etc, we need the ability to
- * mock up the file system so when core tests are run, we aren't mucking
- * in the application directory. this will give finer grained control over
- * these tests. So yeah, while this looks odd, I need to overwrite protected
- * class vars in the loader. So here we go...
- *
- * @covers CI_Loader::__construct()
- */
- public function __construct()
- {
- vfsStreamWrapper::register();
- vfsStreamWrapper::setRoot(new vfsStreamDirectory('application'));
-
- $this->models_dir = vfsStream::newDirectory('models')->at(vfsStreamWrapper::getRoot());
- $this->libs_dir = vfsStream::newDirectory('libraries')->at(vfsStreamWrapper::getRoot());
- $this->helpers_dir = vfsStream::newDirectory('helpers')->at(vfsStreamWrapper::getRoot());
- $this->views_dir = vfsStream::newDirectory('views')->at(vfsStreamWrapper::getRoot());
-
- $this->_ci_ob_level = ob_get_level();
- $this->_ci_library_paths = array(vfsStream::url('application').'/', BASEPATH);
- $this->_ci_helper_paths = array(vfsStream::url('application').'/', BASEPATH);
- $this->_ci_model_paths = array(vfsStream::url('application').'/');
- $this->_ci_view_paths = array(vfsStream::url('application').'/views/' => TRUE);
- }
-}
-
-
class Loader_test extends CI_TestCase {
private $ci_obj;
@@ -40,7 +7,7 @@ class Loader_test extends CI_TestCase {
public function set_up()
{
// Instantiate a new loader
- $this->load = new Extended_Loader();
+ $this->load = new Mock_Core_Loader();
// mock up a ci instance
$this->ci_obj = new StdClass;
@@ -265,7 +232,4 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
-
-
-
}