summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-03 01:09:05 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-03 01:09:05 +0100
commitdd8d3d366bef1bc3fcb4476e88e8e6af44b89973 (patch)
treeb71c41da59ba17daf8b84204713e801ef794c4ea /tests/codeigniter
parent1712f1191f0027b61ca06dae7be303ea1b52f867 (diff)
Fix the bloody tests
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/core/Loader_test.php72
1 files changed, 37 insertions, 35 deletions
diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php
index 02629908f..be223f97d 100644
--- a/tests/codeigniter/core/Loader_test.php
+++ b/tests/codeigniter/core/Loader_test.php
@@ -6,41 +6,6 @@ class Loader_test extends CI_TestCase {
public function set_up()
{
- // Create helper in VFS
- $helper = 'autohelp';
- $hlp_func = '_autohelp_test_func';
- $content = '<?php function '.$hlp_func.'() { return true; }';
- $this->ci_vfs_create($helper.'_helper', $content, $this->ci_app_root, 'helpers');
-
- // Create library in VFS
- $lib = 'autolib';
- $lib_class = 'CI_'.ucfirst($lib);
- $this->ci_vfs_create($lib, '<?php class '.$lib_class.' { }', $this->ci_base_root, 'libraries');
-
- // Create driver in VFS
- $drv = 'autodrv';
- $subdir = ucfirst($drv);
- $drv_class = 'CI_'.$subdir;
- $this->ci_vfs_create($drv, '<?php class '.$drv_class.' { }', $this->ci_base_root, array('libraries', $subdir));
-
- // Create model in VFS package path
- $dir = 'testdir';
- $path = APPPATH.$dir.'/';
- $model = 'automod';
- $mod_class = ucfirst($model);
- $this->ci_vfs_create($model, '<?php class '.$mod_class.' { }', $this->ci_app_root, array($dir, 'models'));
-
- // Create autoloader config
- $cfg = array(
- 'packages' => array($path),
- 'helper' => array($helper),
- 'libraries' => array($lib),
- 'drivers' => array($drv),
- 'model' => array($model),
- 'config' => array('config1', 'config2')
- );
- $this->ci_vfs_create('autoload', '<?php $autoload = '.var_export($cfg, TRUE).';', $this->ci_app_root, 'config');
-
// Instantiate a new loader
$loader = $this->ci_core_class('loader');
$this->load = new $loader();
@@ -493,6 +458,43 @@ class Loader_test extends CI_TestCase {
public function test_initialize()
{
+ // Create helper in VFS
+ $helper = 'autohelp';
+ $hlp_func = '_autohelp_test_func';
+ $content = '<?php function '.$hlp_func.'() { return true; }';
+ $this->ci_vfs_create($helper.'_helper', $content, $this->ci_app_root, 'helpers');
+
+ // Create library in VFS
+ $lib = 'autolib';
+ $lib_class = 'CI_'.ucfirst($lib);
+ $this->ci_vfs_create($lib, '<?php class '.$lib_class.' { }', $this->ci_base_root, 'libraries');
+
+ // Create driver in VFS
+ $drv = 'autodrv';
+ $subdir = ucfirst($drv);
+ $drv_class = 'CI_'.$subdir;
+ $this->ci_vfs_create($drv, '<?php class '.$drv_class.' { }', $this->ci_base_root, array('libraries', $subdir));
+
+ // Create model in VFS package path
+ $dir = 'testdir';
+ $path = APPPATH.$dir.'/';
+ $model = 'automod';
+ $mod_class = ucfirst($model);
+ $this->ci_vfs_create($model, '<?php class '.$mod_class.' { }', $this->ci_app_root, array($dir, 'models'));
+
+ // Create autoloader config
+ $cfg = array(
+ 'packages' => array($path),
+ 'helper' => array($helper),
+ 'libraries' => array($lib),
+ 'drivers' => array($drv),
+ 'model' => array($model),
+ 'config' => array('config1', 'config2')
+ );
+ $this->ci_vfs_create('autoload', '<?php $autoload = '.var_export($cfg, TRUE).';', $this->ci_app_root, 'config');
+
+ $this->load->__construct();
+
// Verify path
$this->assertContains($path, $this->load->get_package_paths());