summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-29 10:37:40 +0200
committerAndrey Andreev <narf@bofh.bg>2012-03-29 10:37:40 +0200
commitfd9e46e852d073ae6fb8680f26e9825805104e1c (patch)
treeab665546f404a61b2a97fa686ce1f7d2a37ffc79 /tests/codeigniter/core
parent16be2c2489535c79b38688413df26f95adbe0ea3 (diff)
parent38b2a256758ee8184d354cbdb0eac467118af36b (diff)
Merge upstream branch
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r--tests/codeigniter/core/Common_test.php5
-rw-r--r--tests/codeigniter/core/Loader_test.php38
-rw-r--r--tests/codeigniter/core/URI_test.php33
3 files changed, 3 insertions, 73 deletions
diff --git a/tests/codeigniter/core/Common_test.php b/tests/codeigniter/core/Common_test.php
index cec12982d..dded2e824 100644
--- a/tests/codeigniter/core/Common_test.php
+++ b/tests/codeigniter/core/Common_test.php
@@ -1,9 +1,6 @@
<?php
-require_once(BASEPATH.'helpers/email_helper.php');
-
-class Common_test extends CI_TestCase
-{
+class Common_test extends CI_TestCase {
// ------------------------------------------------------------------------
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 {
// --------------------------------------------------------------------
-
-
-
}
diff --git a/tests/codeigniter/core/URI_test.php b/tests/codeigniter/core/URI_test.php
index 40252aa14..e340ddf73 100644
--- a/tests/codeigniter/core/URI_test.php
+++ b/tests/codeigniter/core/URI_test.php
@@ -1,41 +1,10 @@
<?php
-require BASEPATH.'core/URI.php';
-
-/**
- * Extend the URI class
- * - override contructor
- * - override CLI detection
- */
-class URI_extended extends CI_URI {
-
- public function __construct()
- {
- $test = CI_TestCase::instance();
- $cls =& $test->ci_core_class('cfg');
-
- // set predictable config values
- $test->ci_set_config(array(
- 'index_page' => 'index.php',
- 'base_url' => 'http://example.com/',
- 'subclass_prefix' => 'MY_'
- ));
-
- $this->config = new $cls;
-
- }
-
- protected function _is_cli_request()
- {
- return FALSE;
- }
-}
-
class URI_test extends CI_TestCase {
public function set_up()
{
- $this->uri = new URI_extended();
+ $this->uri = new Mock_Core_URI();
}
// --------------------------------------------------------------------