Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php class Loader_test extends CI_TestCase { private $ci_obj; public function set_up() {..

Decoded Output download

<?php
 class Loader_test extends CI_TestCase { private $ci_obj; public function set_up() { $loader = $this->ci_core_class("loader"); $this->load = new $loader(); $this->ci_obj = $this->ci_instance(); $this->prefix = "MY_"; $this->ci_set_config("subclass_prefix", $this->prefix); } public function test_library() { $this->assertInstanceOf("CI_Loader", $this->load->library(NULL)); $lib = "unit_test_lib"; $class = "CI_" . ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "<?php class " . $class . " { }", $this->ci_base_root, "libraries"); $this->assertFalse($this->load->is_loaded(ucfirst($lib))); $this->assertInstanceOf("CI_Loader", $this->load->library(array($lib))); $this->assertTrue(class_exists($class), $class . " does not exist"); $this->assertObjectHasAttribute($lib, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$lib}); $lib = array("unit_test_lib" => "unit_test_lib"); $this->assertInstanceOf("CI_Loader", $this->load->library($lib)); $this->assertTrue(class_exists($class), $class . " does not exist"); $this->assertInstanceOf("CI_Loader", $this->load->library($lib, " ")); $lib = "non_existent_test_lib"; $this->setExpectedException("RuntimeException", "CI Error: Unable to load the requested class: " . ucfirst($lib)); $this->assertInstanceOf("CI_Loader", $this->load->library($lib)); } public function test_bad_library() { $lib = "bad_test_lib"; $this->ci_vfs_create(ucfirst($lib), '', $this->ci_app_root, "libraries"); $this->setExpectedException("RuntimeException", "CI Error: Non-existent class: " . ucfirst($lib)); $this->assertInstanceOf("CI_Loader", $this->load->library($lib)); } public function test_library_extension() { $name = "ext_test_lib"; $lib = ucfirst($name); $class = "CI_" . $lib; $ext = $this->prefix . $lib; $this->ci_vfs_create($lib, "<?php class " . $class . " { }", $this->ci_base_root, "libraries"); $this->ci_vfs_create($ext, "<?php class " . $ext . " extends " . $class . " { }", $this->ci_app_root, "libraries"); $this->assertInstanceOf("CI_Loader", $this->load->library($lib)); $this->assertTrue(class_exists($class), $class . " does not exist"); $this->assertTrue(class_exists($ext), $ext . " does not exist"); $this->assertObjectHasAttribute($name, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$name}); $this->assertInstanceOf($ext, $this->ci_obj->{$name}); $obj = "exttest"; $this->assertInstanceOf("CI_Loader", $this->load->library($lib, NULL, $obj)); $this->assertObjectHasAttribute($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$obj}); $this->assertInstanceOf($ext, $this->ci_obj->{$obj}); unset($this->ci_obj->{$name}); $this->assertInstanceOf("CI_Loader", $this->load->library($lib)); $this->assertObjectHasAttribute($name, $this->ci_obj); $name = "ext_baseless_lib"; $lib = ucfirst($name); $class = $this->prefix . $lib; $this->ci_vfs_create($class, "<?php class " . $class . " { }", $this->ci_app_root, "libraries"); $this->setExpectedException("RuntimeException", "CI Error: Unable to load the requested class: " . $lib); $this->assertInstanceOf("CI_Loader", $this->load->library($lib)); } public function test_library_config() { $lib = "unit_test_config_lib"; $class = "CI_" . ucfirst($lib); $content = "<?php class " . $class . " { public function __construct($params) { $this->config = $params; } }"; $this->ci_vfs_create(ucfirst($lib), $content, $this->ci_base_root, "libraries"); $cfg = array("foo" => "bar", "bar" => "baz", "baz" => false); $this->ci_vfs_create($lib, "<?php $config = " . var_export($cfg, TRUE) . ";", $this->ci_app_root, "config"); $obj = "testy"; $this->assertInstanceOf("CI_Loader", $this->load->library($lib, NULL, $obj)); $this->assertTrue(class_exists($class), $class . " does not exist"); $this->assertObjectHasAttribute($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$obj}); $this->assertEquals($cfg, $this->ci_obj->{$obj}->config); $this->assertEquals($obj, $this->load->is_loaded(ucfirst($lib))); $lib = "another_test_lib"; $class = ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "<?php class " . $class . " { }", $this->ci_app_root, "libraries"); $this->setExpectedException("RuntimeException", "CI Error: Resource '" . $obj . "' already exists and is not a " . $class . " instance."); $this->load->library($lib, NULL, $obj); } public function test_load_library_in_application_dir() { $lib = "super_test_library"; $class = ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "<?php class " . $class . " { }", $this->ci_app_root, "libraries"); $this->assertInstanceOf("CI_Loader", $this->load->library($lib)); $this->assertTrue(class_exists($class), $class . " does not exist"); $this->assertObjectHasAttribute($lib, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$lib}); } public function test_driver() { class_exists("CI_Driver_Library", TRUE); $driver = "unit_test_driver"; $dir = ucfirst($driver); $class = "CI_" . $dir; $content = "<?php class " . $class . " { } "; $this->ci_vfs_create(ucfirst($driver), $content, $this->ci_base_root, "libraries/" . $dir); $this->assertInstanceOf("CI_Loader", $this->load->driver(array($driver))); $this->assertTrue(class_exists($class), $class . " does not exist"); $this->assertObjectHasAttribute($driver, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$driver}); $obj = "testdrive"; $this->assertInstanceOf("CI_Loader", $this->load->library($driver, NULL, $obj)); $this->assertObjectHasAttribute($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$obj}); $this->assertInstanceOf("CI_Loader", $this->load->driver($driver, " ")); } public function test_models() { $this->ci_set_core_class("model", "CI_Model"); $model = "Unit_test_model"; $content = "<?php class " . $model . " extends CI_Model {} "; $this->ci_vfs_create($model, $content, $this->ci_app_root, "models"); $this->assertInstanceOf("CI_Loader", $this->load->model($model)); $this->assertTrue(class_exists($model)); $this->assertObjectHasAttribute($model, $this->ci_obj); $this->assertInstanceOf("CI_Loader", $this->load->model('')); } public function test_model_subdir() { $this->ci_core_class("model"); $model = "Test_sub_model"; $base = "CI_Model"; $subdir = "cars"; $this->ci_vfs_create($model, "<?php class " . $model . " extends " . $base . " { }", $this->ci_app_root, array("models", $subdir)); $name = "testors"; $this->assertInstanceOf("CI_Loader", $this->load->model($subdir . "/" . $model, $name)); $this->assertTrue(class_exists($model)); $this->assertObjectHasAttribute($name, $this->ci_obj); $this->assertObjectHasAttribute($name, $this->ci_obj); $this->assertInstanceOf($base, $this->ci_obj->{$name}); $this->assertInstanceOf($model, $this->ci_obj->{$name}); $obj = "conflict"; $this->ci_obj->{$obj} = new stdClass(); $this->setExpectedException("RuntimeException", "The model name you are loading is the name of a resource that is already being used: " . $obj); $this->load->model("not_real", $obj); } public function test_non_existent_model() { $this->setExpectedException("RuntimeException", "Unable to locate the model you have specified: Ci_test_nonexistent_model.php"); $this->load->model("ci_test_nonexistent_model.php"); } public function test_invalid_model() { $this->ci_set_core_class("model", "CI_Model"); $model = "Unit_test_invalid_model"; $content = "<?php class " . $model . " {} "; $this->ci_vfs_create($model, $content, $this->ci_app_root, "models"); $this->setExpectedException("RuntimeException", "Class " . $model . " doesn't extend CI_Model"); $this->load->model($model); } public function test_load_view() { $view = "unit_test_view"; $var = "hello"; $value = "World!"; $content = "This is my test page.  "; $this->ci_vfs_create($view, $content . "<?php echo (isset($" . $var . ") ? $" . $var . " : "undefined");", $this->ci_app_root, "views"); $out = $this->load->view($view, array($var => $value), TRUE); $this->assertEquals($content . $value, $out); $out = $this->load->view($view, array(), TRUE); $this->assertEquals($content . "undefined", $out); $output = $this->getMockBuilder("CI_Output")->setMethods(array("append_output"))->getMock(); $output->expects($this->once())->method("append_output")->with($content . $value); $this->ci_instance_var("output", $output); $vars = new stdClass(); $vars->{$var} = $value; $this->assertInstanceOf("CI_Loader", $this->load->view($view, $vars)); $nesting_view = "unit_test_nesting_view"; $nesting_content = "Here comes a nested view.  "; $this->ci_vfs_create($nesting_view, $nesting_content . "<?php $loader->view("" . $view . "");", $this->ci_app_root, "views"); $out = $this->load->view($nesting_view, array("loader" => $this->load, $var => $value), TRUE); $this->assertEquals($nesting_content . $content . $value, $out); } public function test_non_existent_view() { $this->setExpectedException("RuntimeException", "CI Error: Unable to load the requested file: ci_test_nonexistent_view.php"); $this->load->view("ci_test_nonexistent_view", array("foo" => "bar")); } public function test_file() { $dir = "views"; $file = "ci_test_mock_file"; $content = "Here is a test file, which we will load now."; $this->ci_vfs_create($file, $content, $this->ci_app_root, $dir); $out = $this->load->file(APPPATH . $dir . "/" . $file . ".php", TRUE); $this->assertEquals($content, $out); $this->setExpectedException("RuntimeException", "CI Error: Unable to load the requested file: ci_test_file_not_exists"); $this->load->file("ci_test_file_not_exists", TRUE); } public function test_vars() { $key1 = "foo"; $val1 = "bar"; $key2 = "boo"; $val2 = "hoo"; $this->assertInstanceOf("CI_Loader", $this->load->vars(array($key1 => $val1))); $this->assertInstanceOf("CI_Loader", $this->load->vars($key2, $val2)); $this->assertEquals($val1, $this->load->get_var($key1)); $this->assertEquals(array($key1 => $val1, $key2 => $val2), $this->load->get_vars()); } public function test_clear_vars() { $key1 = "foo"; $val1 = "bar"; $key2 = "boo"; $val2 = "hoo"; $this->assertInstanceOf("CI_Loader", $this->load->vars(array($key1 => $val1))); $this->assertInstanceOf("CI_Loader", $this->load->vars($key2, $val2)); $this->assertEquals($val1, $this->load->get_var($key1)); $this->assertEquals(array($key1 => $val1, $key2 => $val2), $this->load->get_vars()); $this->assertInstanceOf("CI_Loader", $this->load->clear_vars()); $this->assertEquals('', $this->load->get_var($key1)); $this->assertEquals('', $this->load->get_var($key2)); } public function test_helper() { $helper = "test"; $func = "_my_helper_test_func"; $content = "<?php function " . $func . "() { return TRUE; } "; $this->ci_vfs_create($helper . "_helper", $content, $this->ci_base_root, "helpers"); $exfunc = "_my_extension_func"; $content = "<?php function " . $exfunc . "() { return TRUE; } "; $this->ci_vfs_create($this->prefix . $helper . "_helper", $content, $this->ci_app_root, "helpers"); $this->assertInstanceOf("CI_Loader", $this->load->helper($helper)); $this->assertTrue(function_exists($func), $func . " does not exist"); $this->assertTrue(function_exists($exfunc), $exfunc . " does not exist"); $ext = "bad_ext"; $this->ci_vfs_create($this->prefix . $ext . "_helper", '', $this->ci_app_root, "helpers"); $this->setExpectedException("RuntimeException", "CI Error: Unable to load the requested file: helpers/" . $ext . "_helper.php"); $this->load->helper($ext); } public function test_non_existent_helper() { $this->setExpectedException("RuntimeException", "CI Error: Unable to load the requested file: helpers/bad_helper.php"); $this->load->helper("bad"); } public function test_loading_multiple_helpers() { $helpers = array(); $funcs = array(); $files = array(); for ($i = 1; $i <= 3; ++$i) { $helper = "test" . $i; $helpers[] = $helper; $func = "_my_helper_test_func" . $i; $funcs[] = $func; $files[$helper . "_helper"] = "<?php function " . $func . "() { return TRUE; } "; } $this->ci_vfs_create($files, NULL, $this->ci_base_root, "helpers"); $this->assertInstanceOf("CI_Loader", $this->load->helpers($helpers)); foreach ($funcs as $func) { $this->assertTrue(function_exists($func), $func . " does not exist"); } } public function test_language() { $file = "test"; $lang = $this->getMockBuilder("CI_Lang")->setMethods(array("load"))->getMock(); $lang->expects($this->once())->method("load")->with($file); $this->ci_instance_var("lang", $lang); $this->assertInstanceOf("CI_Loader", $this->load->language($file)); } public function test_packages() { $dir = "third-party"; $lib = "unit_test_package"; $class = ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "<?php class " . $class . " { }", $this->ci_app_root, array($dir, "libraries")); $paths = $this->load->get_package_paths(TRUE); $this->setExpectedException("RuntimeException", "CI Error: Unable to load the requested class: " . ucfirst($lib)); $this->load->library($lib); $path = APPPATH . $dir . "/"; $this->assertInstanceOf("CI_Loader", $this->load->add_package_path($path)); $this->assertContains($path, $this->load->get_package_paths(TRUE)); $this->assertInstanceOf("CI_Loader", $this->load->library($lib)); $this->assertTrue(class_exists($class), $class . " does not exist"); $path2 = APPPATH . "another/"; $this->assertInstanceOf("CI_Loader", $this->load->add_package_path($path2)); $this->assertContains($path2, $this->load->get_package_paths(TRUE)); $this->assertInstanceOf("CI_Loader", $this->load->remove_package_path()); $this->assertNotContains($path2, $this->load->get_package_paths(TRUE)); $this->assertInstanceOf("CI_Loader", $this->load->remove_package_path($path)); $this->assertEquals($paths, $this->load->get_package_paths(TRUE)); } public function test_remove_package_path() { $dir = "third-party"; $path = APPPATH . $dir . "/"; $path2 = APPPATH . "another/"; $paths = $this->load->get_package_paths(TRUE); $this->assertInstanceOf("CI_Loader", $this->load->add_package_path($path)); $this->assertInstanceOf("CI_Loader", $this->load->remove_package_path($path)); $this->assertEquals($paths, $this->load->get_package_paths(TRUE)); $this->assertInstanceOf("CI_Loader", $this->load->add_package_path($path2)); $this->assertInstanceOf("CI_Loader", $this->load->remove_package_path()); $this->assertNotContains($path2, $this->load->get_package_paths(TRUE)); } public function test_load_config() { $cfg = "someconfig"; $this->assertTrue($this->load->config($cfg, FALSE)); $this->assertContains($cfg, $this->ci_obj->config->loaded); } public function test_initialize() { $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"); $lib = "autolib"; $lib_class = "CI_" . ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "<?php class " . $lib_class . " { }", $this->ci_base_root, "libraries"); $drv = "autodrv"; $subdir = ucfirst($drv); $drv_class = "CI_" . $subdir; $this->ci_vfs_create(ucfirst($drv), "<?php class " . $drv_class . " { }", $this->ci_base_root, array("libraries", $subdir)); $dir = "testdir"; $path = APPPATH . $dir . "/"; $model = "Automod"; $this->ci_vfs_create($model, "<?php class " . $model . " extends CI_Model { }", $this->ci_app_root, array($dir, "models")); $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->initialize(); $this->assertContains($path, $this->load->get_package_paths()); $this->assertTrue(function_exists($hlp_func), $hlp_func . " does not exist"); $this->assertTrue(class_exists($lib_class), $lib_class . " does not exist"); $this->assertObjectHasAttribute($lib, $this->ci_obj); $this->assertInstanceOf($lib_class, $this->ci_obj->{$lib}); $this->assertTrue(class_exists($drv_class), $drv_class . " does not exist"); $this->assertObjectHasAttribute($drv, $this->ci_obj); $this->assertInstanceOf($drv_class, $this->ci_obj->{$drv}); $this->assertTrue(class_exists($model), $model . " does not exist"); $this->assertObjectHasAttribute($model, $this->ci_obj); $this->assertInstanceOf($model, $this->ci_obj->{$model}); $this->assertEquals($cfg["config"], $this->ci_obj->config->loaded); } } ?>

Did this file decode correctly?

Original Code

<?php
 class Loader_test extends CI_TestCase { private $ci_obj; public function set_up() { $loader = $this->ci_core_class("\154\x6f\x61\x64\x65\x72"); $this->load = new $loader(); $this->ci_obj = $this->ci_instance(); $this->prefix = "\115\131\137"; $this->ci_set_config("\x73\x75\x62\143\154\x61\x73\163\x5f\x70\162\145\146\x69\170", $this->prefix); } public function test_library() { $this->assertInstanceOf("\x43\x49\137\114\x6f\141\144\145\x72", $this->load->library(NULL)); $lib = "\165\x6e\x69\164\137\x74\145\x73\164\x5f\x6c\x69\142"; $class = "\103\x49\x5f" . ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "\x3c\77\x70\150\x70\40\x63\x6c\x61\x73\x73\x20" . $class . "\x20\173\40\x7d", $this->ci_base_root, "\x6c\x69\x62\162\141\162\151\145\x73"); $this->assertFalse($this->load->is_loaded(ucfirst($lib))); $this->assertInstanceOf("\103\x49\137\114\157\x61\x64\145\162", $this->load->library(array($lib))); $this->assertTrue(class_exists($class), $class . "\40\x64\x6f\x65\x73\40\156\x6f\164\x20\x65\x78\x69\x73\164"); $this->assertObjectHasAttribute($lib, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$lib}); $lib = array("\165\x6e\x69\164\x5f\164\x65\163\164\137\x6c\151\142" => "\165\156\x69\x74\x5f\x74\145\x73\x74\x5f\x6c\x69\142"); $this->assertInstanceOf("\103\111\x5f\114\157\141\144\145\x72", $this->load->library($lib)); $this->assertTrue(class_exists($class), $class . "\40\144\157\x65\163\40\156\157\164\40\x65\170\151\163\164"); $this->assertInstanceOf("\x43\111\137\114\157\141\144\145\162", $this->load->library($lib, "\40")); $lib = "\156\157\x6e\x5f\x65\x78\151\x73\x74\x65\x6e\164\x5f\x74\145\163\164\x5f\x6c\x69\142"; $this->setExpectedException("\x52\x75\x6e\x74\x69\155\x65\105\x78\x63\145\x70\x74\151\x6f\156", "\x43\111\x20\105\x72\x72\157\x72\x3a\40\x55\156\141\142\154\x65\40\164\x6f\40\x6c\157\x61\144\40\164\x68\145\40\x72\x65\x71\x75\x65\x73\x74\x65\x64\x20\x63\x6c\x61\x73\x73\72\x20" . ucfirst($lib)); $this->assertInstanceOf("\103\111\137\x4c\x6f\141\x64\x65\162", $this->load->library($lib)); } public function test_bad_library() { $lib = "\142\141\144\x5f\x74\x65\163\164\x5f\154\x69\142"; $this->ci_vfs_create(ucfirst($lib), '', $this->ci_app_root, "\x6c\x69\142\162\x61\x72\151\145\163"); $this->setExpectedException("\x52\165\x6e\x74\x69\x6d\x65\105\x78\x63\x65\160\164\x69\157\156", "\x43\111\40\105\x72\162\x6f\162\x3a\x20\116\x6f\156\x2d\x65\170\x69\163\164\145\156\164\40\x63\x6c\x61\x73\163\x3a\x20" . ucfirst($lib)); $this->assertInstanceOf("\103\x49\137\114\x6f\141\x64\145\162", $this->load->library($lib)); } public function test_library_extension() { $name = "\x65\x78\x74\x5f\x74\x65\163\x74\137\x6c\x69\x62"; $lib = ucfirst($name); $class = "\x43\111\137" . $lib; $ext = $this->prefix . $lib; $this->ci_vfs_create($lib, "\74\77\160\150\160\40\143\x6c\x61\x73\x73\40" . $class . "\40\173\x20\x7d", $this->ci_base_root, "\154\x69\x62\162\x61\x72\151\145\163"); $this->ci_vfs_create($ext, "\x3c\77\x70\150\x70\40\143\x6c\141\x73\163\40" . $ext . "\40\145\170\x74\x65\x6e\x64\163\40" . $class . "\x20\x7b\40\x7d", $this->ci_app_root, "\154\x69\x62\162\141\x72\151\x65\x73"); $this->assertInstanceOf("\103\111\137\x4c\x6f\141\x64\x65\x72", $this->load->library($lib)); $this->assertTrue(class_exists($class), $class . "\40\144\157\x65\163\x20\x6e\157\x74\x20\145\170\151\163\164"); $this->assertTrue(class_exists($ext), $ext . "\x20\144\x6f\x65\163\40\156\157\x74\40\145\x78\151\x73\x74"); $this->assertObjectHasAttribute($name, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$name}); $this->assertInstanceOf($ext, $this->ci_obj->{$name}); $obj = "\145\x78\164\164\x65\x73\x74"; $this->assertInstanceOf("\103\x49\x5f\x4c\157\141\144\145\162", $this->load->library($lib, NULL, $obj)); $this->assertObjectHasAttribute($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$obj}); $this->assertInstanceOf($ext, $this->ci_obj->{$obj}); unset($this->ci_obj->{$name}); $this->assertInstanceOf("\103\x49\137\114\157\x61\144\145\162", $this->load->library($lib)); $this->assertObjectHasAttribute($name, $this->ci_obj); $name = "\x65\x78\164\x5f\x62\x61\163\145\x6c\x65\163\163\x5f\154\151\142"; $lib = ucfirst($name); $class = $this->prefix . $lib; $this->ci_vfs_create($class, "\74\x3f\160\150\160\40\x63\x6c\x61\163\x73\40" . $class . "\x20\x7b\x20\175", $this->ci_app_root, "\154\151\142\162\141\x72\x69\x65\x73"); $this->setExpectedException("\x52\165\156\164\151\155\x65\x45\x78\x63\145\160\164\x69\x6f\156", "\103\x49\x20\x45\x72\162\157\162\72\x20\x55\156\x61\x62\x6c\x65\x20\x74\x6f\x20\x6c\x6f\141\144\x20\164\150\145\x20\162\145\161\x75\145\x73\x74\145\144\x20\143\x6c\141\163\163\x3a\x20" . $lib); $this->assertInstanceOf("\103\111\x5f\x4c\x6f\141\144\x65\x72", $this->load->library($lib)); } public function test_library_config() { $lib = "\x75\x6e\151\x74\137\164\x65\x73\164\137\143\157\x6e\146\x69\147\137\x6c\x69\142"; $class = "\x43\x49\137" . ucfirst($lib); $content = "\x3c\x3f\x70\x68\160\x20\x63\154\141\x73\x73\40" . $class . "\x20\x7b\40\160\165\x62\154\151\143\x20\x66\x75\x6e\x63\x74\x69\x6f\156\40\137\x5f\x63\x6f\x6e\163\164\x72\165\143\164\x28\x24\x70\x61\162\141\x6d\163\x29\x20\173\x20\44\x74\x68\151\163\x2d\x3e\x63\x6f\x6e\146\x69\x67\40\x3d\40\x24\x70\141\x72\141\x6d\163\x3b\x20\175\x20\x7d"; $this->ci_vfs_create(ucfirst($lib), $content, $this->ci_base_root, "\x6c\x69\x62\x72\141\162\x69\145\x73"); $cfg = array("\146\157\157" => "\x62\141\162", "\x62\x61\162" => "\x62\141\x7a", "\142\x61\172" => false); $this->ci_vfs_create($lib, "\x3c\x3f\x70\150\x70\40\x24\x63\157\x6e\146\151\147\x20\75\40" . var_export($cfg, TRUE) . "\x3b", $this->ci_app_root, "\x63\x6f\x6e\146\151\x67"); $obj = "\164\x65\163\x74\x79"; $this->assertInstanceOf("\103\111\137\x4c\157\141\144\x65\x72", $this->load->library($lib, NULL, $obj)); $this->assertTrue(class_exists($class), $class . "\x20\144\157\145\163\40\x6e\157\164\40\145\x78\x69\x73\x74"); $this->assertObjectHasAttribute($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$obj}); $this->assertEquals($cfg, $this->ci_obj->{$obj}->config); $this->assertEquals($obj, $this->load->is_loaded(ucfirst($lib))); $lib = "\141\x6e\x6f\164\x68\145\x72\137\164\x65\x73\164\x5f\154\151\142"; $class = ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "\74\x3f\x70\x68\160\40\143\x6c\x61\163\163\40" . $class . "\40\173\x20\x7d", $this->ci_app_root, "\154\x69\x62\162\x61\162\151\145\163"); $this->setExpectedException("\122\x75\x6e\x74\151\x6d\145\105\x78\x63\145\x70\x74\x69\157\156", "\103\x49\x20\105\x72\162\157\x72\x3a\x20\x52\145\x73\x6f\165\x72\143\x65\x20\47" . $obj . "\x27\x20\141\154\x72\145\141\144\171\40\x65\170\151\x73\164\163\x20\x61\x6e\x64\x20\x69\x73\40\156\157\x74\x20\x61\40" . $class . "\x20\x69\x6e\x73\164\x61\x6e\143\x65\56"); $this->load->library($lib, NULL, $obj); } public function test_load_library_in_application_dir() { $lib = "\163\x75\160\x65\x72\137\x74\145\x73\164\x5f\x6c\x69\142\x72\x61\x72\x79"; $class = ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "\74\77\x70\150\x70\40\x63\x6c\141\163\163\40" . $class . "\40\173\40\175", $this->ci_app_root, "\x6c\x69\142\x72\x61\162\x69\145\163"); $this->assertInstanceOf("\103\111\x5f\x4c\157\x61\x64\145\162", $this->load->library($lib)); $this->assertTrue(class_exists($class), $class . "\40\x64\157\145\x73\40\156\157\x74\x20\145\170\151\x73\164"); $this->assertObjectHasAttribute($lib, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$lib}); } public function test_driver() { class_exists("\x43\111\x5f\x44\x72\x69\166\145\x72\x5f\x4c\x69\x62\x72\x61\x72\171", TRUE); $driver = "\x75\x6e\151\x74\x5f\x74\x65\163\164\137\144\162\x69\x76\145\x72"; $dir = ucfirst($driver); $class = "\103\111\x5f" . $dir; $content = "\x3c\x3f\x70\150\160\40\x63\x6c\141\x73\163\x20" . $class . "\40\x7b\40\175\x20"; $this->ci_vfs_create(ucfirst($driver), $content, $this->ci_base_root, "\x6c\x69\142\162\141\162\151\145\x73\x2f" . $dir); $this->assertInstanceOf("\x43\x49\x5f\114\157\141\x64\x65\x72", $this->load->driver(array($driver))); $this->assertTrue(class_exists($class), $class . "\40\144\157\x65\x73\x20\x6e\x6f\164\40\x65\170\x69\163\164"); $this->assertObjectHasAttribute($driver, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$driver}); $obj = "\x74\145\163\164\144\162\151\166\x65"; $this->assertInstanceOf("\x43\x49\137\114\x6f\141\x64\145\162", $this->load->library($driver, NULL, $obj)); $this->assertObjectHasAttribute($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->{$obj}); $this->assertInstanceOf("\103\x49\137\114\x6f\141\144\145\x72", $this->load->driver($driver, "\40")); } public function test_models() { $this->ci_set_core_class("\155\157\x64\145\x6c", "\x43\111\137\x4d\157\144\145\154"); $model = "\x55\x6e\151\164\137\x74\145\x73\164\x5f\155\x6f\144\x65\154"; $content = "\74\77\160\x68\160\x20\143\x6c\141\x73\163\x20" . $model . "\40\x65\x78\164\145\156\x64\163\40\x43\x49\x5f\115\157\144\145\x6c\40\173\175\40"; $this->ci_vfs_create($model, $content, $this->ci_app_root, "\155\157\x64\x65\154\163"); $this->assertInstanceOf("\103\111\x5f\114\x6f\141\x64\145\162", $this->load->model($model)); $this->assertTrue(class_exists($model)); $this->assertObjectHasAttribute($model, $this->ci_obj); $this->assertInstanceOf("\x43\x49\137\x4c\157\141\144\145\x72", $this->load->model('')); } public function test_model_subdir() { $this->ci_core_class("\x6d\157\144\145\154"); $model = "\124\145\x73\x74\x5f\163\165\142\x5f\x6d\x6f\144\x65\x6c"; $base = "\103\x49\x5f\x4d\157\x64\x65\154"; $subdir = "\x63\141\x72\163"; $this->ci_vfs_create($model, "\x3c\x3f\x70\150\x70\x20\x63\x6c\141\163\x73\x20" . $model . "\40\x65\170\x74\x65\x6e\144\163\x20" . $base . "\x20\x7b\40\175", $this->ci_app_root, array("\x6d\157\144\145\x6c\x73", $subdir)); $name = "\164\145\163\x74\157\162\x73"; $this->assertInstanceOf("\x43\x49\x5f\114\x6f\x61\x64\145\162", $this->load->model($subdir . "\x2f" . $model, $name)); $this->assertTrue(class_exists($model)); $this->assertObjectHasAttribute($name, $this->ci_obj); $this->assertObjectHasAttribute($name, $this->ci_obj); $this->assertInstanceOf($base, $this->ci_obj->{$name}); $this->assertInstanceOf($model, $this->ci_obj->{$name}); $obj = "\x63\157\x6e\146\154\151\x63\x74"; $this->ci_obj->{$obj} = new stdClass(); $this->setExpectedException("\122\x75\156\x74\x69\155\145\x45\170\x63\145\160\x74\x69\157\156", "\x54\150\x65\40\155\x6f\144\145\154\40\x6e\x61\x6d\145\40\x79\x6f\x75\x20\141\x72\x65\x20\x6c\157\141\x64\151\x6e\147\x20\x69\163\40\164\150\x65\x20\x6e\141\x6d\145\40\x6f\146\x20\x61\40\x72\x65\x73\157\x75\x72\143\x65\x20\x74\150\141\x74\40\x69\163\40\141\x6c\162\x65\x61\144\171\40\x62\x65\x69\x6e\x67\40\x75\163\x65\144\x3a\40" . $obj); $this->load->model("\156\157\164\137\x72\145\141\x6c", $obj); } public function test_non_existent_model() { $this->setExpectedException("\x52\165\156\164\x69\155\x65\105\170\x63\x65\x70\164\x69\x6f\156", "\x55\156\x61\142\154\x65\x20\164\157\40\x6c\157\143\141\x74\145\40\164\150\145\40\x6d\157\x64\145\154\x20\171\157\165\x20\150\x61\x76\x65\x20\163\160\x65\x63\151\146\x69\x65\x64\72\x20\103\x69\x5f\164\x65\x73\x74\137\156\x6f\156\x65\170\151\163\164\x65\156\x74\137\x6d\157\x64\x65\154\56\x70\150\x70"); $this->load->model("\x63\x69\137\164\x65\x73\164\x5f\156\x6f\156\145\170\x69\163\164\x65\x6e\x74\x5f\x6d\x6f\x64\145\x6c\56\160\x68\160"); } public function test_invalid_model() { $this->ci_set_core_class("\x6d\157\x64\145\154", "\x43\111\x5f\115\x6f\x64\x65\154"); $model = "\x55\x6e\x69\164\137\x74\x65\163\x74\137\151\x6e\166\141\154\151\x64\x5f\x6d\157\x64\x65\x6c"; $content = "\74\77\x70\150\x70\x20\x63\x6c\141\x73\163\40" . $model . "\40\x7b\x7d\40"; $this->ci_vfs_create($model, $content, $this->ci_app_root, "\155\x6f\144\145\x6c\163"); $this->setExpectedException("\122\x75\156\164\x69\x6d\145\x45\170\143\x65\x70\164\x69\x6f\x6e", "\x43\x6c\141\x73\163\x20" . $model . "\x20\x64\157\145\x73\x6e\47\164\40\x65\x78\164\145\x6e\144\40\x43\x49\137\115\x6f\144\145\154"); $this->load->model($model); } public function test_load_view() { $view = "\x75\156\x69\164\x5f\164\x65\x73\x74\x5f\166\151\145\x77"; $var = "\150\x65\x6c\154\x6f"; $value = "\x57\157\x72\154\x64\x21"; $content = "\x54\150\x69\x73\x20\x69\x73\x20\155\x79\x20\x74\x65\163\x74\40\x70\x61\147\145\56\40\x20"; $this->ci_vfs_create($view, $content . "\x3c\x3f\x70\150\x70\40\x65\143\x68\x6f\x20\50\151\x73\163\x65\x74\50\44" . $var . "\x29\40\77\x20\44" . $var . "\40\72\40\42\165\156\x64\x65\146\x69\x6e\x65\144\x22\51\73", $this->ci_app_root, "\x76\x69\x65\x77\163"); $out = $this->load->view($view, array($var => $value), TRUE); $this->assertEquals($content . $value, $out); $out = $this->load->view($view, array(), TRUE); $this->assertEquals($content . "\x75\156\x64\145\x66\151\156\145\144", $out); $output = $this->getMockBuilder("\103\111\137\117\x75\164\160\x75\x74")->setMethods(array("\x61\x70\160\x65\156\x64\x5f\x6f\x75\164\160\x75\x74"))->getMock(); $output->expects($this->once())->method("\141\160\x70\145\156\x64\137\157\165\x74\x70\165\164")->with($content . $value); $this->ci_instance_var("\x6f\x75\164\160\x75\x74", $output); $vars = new stdClass(); $vars->{$var} = $value; $this->assertInstanceOf("\103\111\x5f\x4c\x6f\141\x64\145\162", $this->load->view($view, $vars)); $nesting_view = "\x75\156\151\x74\x5f\164\x65\163\164\x5f\156\x65\x73\x74\151\x6e\x67\x5f\x76\151\145\x77"; $nesting_content = "\110\x65\162\145\x20\143\157\x6d\x65\x73\x20\141\x20\x6e\x65\163\164\145\144\40\x76\x69\x65\167\x2e\40\40"; $this->ci_vfs_create($nesting_view, $nesting_content . "\74\x3f\x70\150\160\x20\44\154\157\141\x64\x65\162\x2d\x3e\166\x69\145\167\50\x22" . $view . "\x22\51\73", $this->ci_app_root, "\x76\x69\145\x77\163"); $out = $this->load->view($nesting_view, array("\x6c\157\x61\x64\x65\x72" => $this->load, $var => $value), TRUE); $this->assertEquals($nesting_content . $content . $value, $out); } public function test_non_existent_view() { $this->setExpectedException("\122\165\x6e\164\151\x6d\145\x45\x78\143\145\160\x74\x69\157\156", "\x43\x49\40\105\162\162\x6f\162\x3a\40\125\156\x61\x62\x6c\145\40\x74\x6f\x20\154\x6f\141\144\x20\164\150\145\40\x72\x65\x71\x75\145\x73\x74\145\144\40\146\x69\154\x65\72\40\143\x69\x5f\x74\145\163\164\x5f\156\x6f\156\145\170\x69\163\164\145\156\x74\137\166\x69\145\167\x2e\x70\x68\x70"); $this->load->view("\x63\151\x5f\164\145\163\x74\137\156\x6f\156\145\x78\x69\x73\x74\145\156\164\x5f\166\151\145\167", array("\x66\157\157" => "\142\141\x72")); } public function test_file() { $dir = "\x76\x69\145\x77\x73"; $file = "\x63\x69\137\164\145\163\x74\x5f\155\157\x63\x6b\x5f\146\x69\154\145"; $content = "\110\145\x72\x65\x20\151\x73\x20\x61\40\164\145\x73\164\x20\x66\x69\x6c\x65\x2c\x20\167\x68\151\x63\x68\40\x77\145\40\167\151\154\x6c\40\x6c\157\x61\x64\40\156\157\167\56"; $this->ci_vfs_create($file, $content, $this->ci_app_root, $dir); $out = $this->load->file(APPPATH . $dir . "\x2f" . $file . "\x2e\x70\150\x70", TRUE); $this->assertEquals($content, $out); $this->setExpectedException("\122\165\156\164\x69\155\145\105\x78\143\145\x70\x74\151\157\x6e", "\103\x49\x20\x45\162\x72\x6f\x72\x3a\40\125\x6e\141\x62\154\145\40\x74\157\40\154\157\141\x64\x20\164\x68\145\40\162\x65\161\x75\145\163\164\x65\144\40\146\151\154\145\72\40\x63\x69\x5f\x74\145\x73\164\x5f\146\x69\x6c\145\137\x6e\x6f\x74\x5f\x65\x78\151\163\164\x73"); $this->load->file("\143\x69\x5f\164\145\x73\x74\137\146\x69\x6c\145\137\x6e\x6f\x74\x5f\145\x78\x69\163\164\x73", TRUE); } public function test_vars() { $key1 = "\146\x6f\157"; $val1 = "\142\141\x72"; $key2 = "\x62\157\x6f"; $val2 = "\x68\157\x6f"; $this->assertInstanceOf("\103\111\x5f\x4c\157\141\x64\145\162", $this->load->vars(array($key1 => $val1))); $this->assertInstanceOf("\x43\111\x5f\114\157\x61\144\145\x72", $this->load->vars($key2, $val2)); $this->assertEquals($val1, $this->load->get_var($key1)); $this->assertEquals(array($key1 => $val1, $key2 => $val2), $this->load->get_vars()); } public function test_clear_vars() { $key1 = "\x66\157\x6f"; $val1 = "\x62\141\x72"; $key2 = "\142\157\x6f"; $val2 = "\150\x6f\157"; $this->assertInstanceOf("\103\x49\137\114\157\x61\x64\x65\162", $this->load->vars(array($key1 => $val1))); $this->assertInstanceOf("\x43\111\x5f\x4c\157\x61\x64\145\x72", $this->load->vars($key2, $val2)); $this->assertEquals($val1, $this->load->get_var($key1)); $this->assertEquals(array($key1 => $val1, $key2 => $val2), $this->load->get_vars()); $this->assertInstanceOf("\103\111\x5f\x4c\157\x61\x64\x65\x72", $this->load->clear_vars()); $this->assertEquals('', $this->load->get_var($key1)); $this->assertEquals('', $this->load->get_var($key2)); } public function test_helper() { $helper = "\164\145\x73\164"; $func = "\137\155\171\x5f\x68\145\x6c\160\145\x72\x5f\164\145\163\x74\137\x66\x75\156\143"; $content = "\74\77\x70\x68\x70\40\146\165\156\143\x74\x69\157\x6e\x20" . $func . "\x28\51\x20\x7b\x20\162\145\x74\x75\162\156\40\124\x52\x55\x45\x3b\x20\x7d\40"; $this->ci_vfs_create($helper . "\x5f\150\145\x6c\x70\145\162", $content, $this->ci_base_root, "\x68\x65\x6c\x70\x65\162\x73"); $exfunc = "\x5f\155\x79\137\145\x78\164\145\156\x73\x69\x6f\x6e\137\x66\165\156\x63"; $content = "\74\77\160\150\160\40\x66\x75\x6e\x63\164\x69\157\x6e\40" . $exfunc . "\x28\x29\40\173\x20\x72\145\164\x75\x72\x6e\40\x54\122\x55\105\x3b\40\175\x20"; $this->ci_vfs_create($this->prefix . $helper . "\137\x68\145\154\x70\145\x72", $content, $this->ci_app_root, "\x68\x65\154\160\x65\162\x73"); $this->assertInstanceOf("\x43\x49\x5f\x4c\157\x61\144\145\x72", $this->load->helper($helper)); $this->assertTrue(function_exists($func), $func . "\x20\144\157\145\163\x20\156\157\164\x20\x65\x78\151\x73\x74"); $this->assertTrue(function_exists($exfunc), $exfunc . "\x20\144\x6f\145\x73\40\x6e\157\x74\40\x65\x78\x69\163\164"); $ext = "\142\x61\x64\x5f\x65\170\x74"; $this->ci_vfs_create($this->prefix . $ext . "\137\x68\145\x6c\x70\145\162", '', $this->ci_app_root, "\150\x65\154\x70\145\x72\163"); $this->setExpectedException("\122\165\156\x74\x69\155\x65\105\170\143\x65\x70\x74\x69\x6f\156", "\x43\111\40\105\162\162\x6f\162\x3a\40\125\156\x61\x62\x6c\x65\x20\x74\x6f\x20\154\x6f\141\x64\x20\x74\150\145\40\x72\x65\161\165\x65\163\164\145\x64\x20\x66\x69\x6c\145\x3a\40\x68\145\x6c\x70\145\x72\x73\57" . $ext . "\137\150\x65\154\x70\145\x72\x2e\160\150\160"); $this->load->helper($ext); } public function test_non_existent_helper() { $this->setExpectedException("\x52\x75\x6e\x74\151\155\145\105\170\143\145\x70\x74\151\x6f\x6e", "\103\111\x20\105\162\162\x6f\x72\x3a\40\x55\156\x61\142\154\145\40\x74\157\x20\x6c\x6f\141\144\40\164\150\145\x20\162\145\x71\165\x65\163\164\x65\x64\40\146\x69\x6c\x65\72\40\x68\145\x6c\x70\x65\162\163\x2f\x62\141\x64\137\150\145\x6c\x70\145\x72\56\160\x68\x70"); $this->load->helper("\x62\141\144"); } public function test_loading_multiple_helpers() { $helpers = array(); $funcs = array(); $files = array(); for ($i = 1; $i <= 3; ++$i) { $helper = "\164\145\163\164" . $i; $helpers[] = $helper; $func = "\x5f\155\171\137\150\145\x6c\x70\x65\162\x5f\164\x65\x73\x74\x5f\x66\165\156\x63" . $i; $funcs[] = $func; $files[$helper . "\x5f\x68\145\x6c\160\x65\x72"] = "\x3c\77\160\x68\160\x20\146\x75\156\x63\x74\x69\x6f\156\40" . $func . "\x28\51\40\x7b\x20\162\145\x74\x75\162\156\x20\124\122\125\x45\x3b\x20\175\x20"; } $this->ci_vfs_create($files, NULL, $this->ci_base_root, "\x68\145\x6c\160\145\x72\163"); $this->assertInstanceOf("\103\x49\x5f\x4c\157\141\144\x65\x72", $this->load->helpers($helpers)); foreach ($funcs as $func) { $this->assertTrue(function_exists($func), $func . "\x20\x64\157\x65\x73\x20\156\x6f\164\40\x65\x78\x69\x73\x74"); } } public function test_language() { $file = "\164\145\x73\x74"; $lang = $this->getMockBuilder("\103\x49\137\x4c\x61\156\147")->setMethods(array("\x6c\157\141\x64"))->getMock(); $lang->expects($this->once())->method("\x6c\157\x61\144")->with($file); $this->ci_instance_var("\154\x61\156\147", $lang); $this->assertInstanceOf("\103\111\x5f\x4c\157\141\144\x65\x72", $this->load->language($file)); } public function test_packages() { $dir = "\164\x68\151\162\144\x2d\x70\x61\x72\164\171"; $lib = "\x75\156\151\164\x5f\164\145\x73\x74\137\160\x61\143\153\x61\147\145"; $class = ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "\74\77\x70\150\160\x20\143\x6c\141\163\x73\x20" . $class . "\40\x7b\x20\175", $this->ci_app_root, array($dir, "\154\151\x62\162\x61\162\x69\x65\x73")); $paths = $this->load->get_package_paths(TRUE); $this->setExpectedException("\122\165\156\x74\151\155\145\105\x78\x63\145\x70\164\x69\x6f\x6e", "\103\x49\40\105\x72\x72\x6f\x72\72\40\x55\x6e\141\142\154\145\x20\x74\x6f\40\154\x6f\x61\144\x20\164\150\x65\x20\162\145\x71\165\x65\163\164\145\x64\40\143\x6c\x61\163\x73\72\x20" . ucfirst($lib)); $this->load->library($lib); $path = APPPATH . $dir . "\57"; $this->assertInstanceOf("\x43\x49\137\x4c\157\141\144\145\162", $this->load->add_package_path($path)); $this->assertContains($path, $this->load->get_package_paths(TRUE)); $this->assertInstanceOf("\x43\111\137\114\x6f\141\144\145\x72", $this->load->library($lib)); $this->assertTrue(class_exists($class), $class . "\40\x64\x6f\145\163\x20\156\157\164\x20\145\170\x69\x73\x74"); $path2 = APPPATH . "\x61\x6e\157\164\150\x65\x72\x2f"; $this->assertInstanceOf("\x43\x49\x5f\x4c\157\x61\x64\145\162", $this->load->add_package_path($path2)); $this->assertContains($path2, $this->load->get_package_paths(TRUE)); $this->assertInstanceOf("\x43\111\137\114\157\141\144\145\x72", $this->load->remove_package_path()); $this->assertNotContains($path2, $this->load->get_package_paths(TRUE)); $this->assertInstanceOf("\103\111\137\114\157\141\x64\x65\x72", $this->load->remove_package_path($path)); $this->assertEquals($paths, $this->load->get_package_paths(TRUE)); } public function test_remove_package_path() { $dir = "\x74\x68\151\162\144\55\x70\x61\x72\x74\x79"; $path = APPPATH . $dir . "\x2f"; $path2 = APPPATH . "\141\x6e\x6f\x74\150\145\162\x2f"; $paths = $this->load->get_package_paths(TRUE); $this->assertInstanceOf("\103\111\x5f\x4c\x6f\x61\144\x65\x72", $this->load->add_package_path($path)); $this->assertInstanceOf("\x43\x49\137\x4c\x6f\x61\x64\145\x72", $this->load->remove_package_path($path)); $this->assertEquals($paths, $this->load->get_package_paths(TRUE)); $this->assertInstanceOf("\103\x49\137\114\157\141\x64\145\162", $this->load->add_package_path($path2)); $this->assertInstanceOf("\103\111\137\114\x6f\x61\144\x65\162", $this->load->remove_package_path()); $this->assertNotContains($path2, $this->load->get_package_paths(TRUE)); } public function test_load_config() { $cfg = "\163\157\155\x65\x63\x6f\x6e\x66\x69\147"; $this->assertTrue($this->load->config($cfg, FALSE)); $this->assertContains($cfg, $this->ci_obj->config->loaded); } public function test_initialize() { $helper = "\x61\165\x74\x6f\150\x65\154\160"; $hlp_func = "\x5f\x61\x75\164\x6f\x68\145\154\x70\x5f\x74\145\163\164\137\x66\x75\x6e\x63"; $content = "\74\77\160\x68\x70\x20\x66\165\x6e\143\x74\x69\157\156\40" . $hlp_func . "\x28\51\40\173\40\162\145\164\x75\162\156\x20\124\x52\x55\105\73\x20\175"; $this->ci_vfs_create($helper . "\x5f\150\145\x6c\160\x65\162", $content, $this->ci_app_root, "\150\145\x6c\160\x65\162\163"); $lib = "\x61\165\x74\157\154\x69\x62"; $lib_class = "\103\x49\x5f" . ucfirst($lib); $this->ci_vfs_create(ucfirst($lib), "\x3c\x3f\160\150\160\40\143\x6c\141\163\163\40" . $lib_class . "\x20\173\40\175", $this->ci_base_root, "\x6c\x69\x62\162\141\x72\x69\x65\163"); $drv = "\141\165\x74\x6f\x64\162\166"; $subdir = ucfirst($drv); $drv_class = "\103\x49\137" . $subdir; $this->ci_vfs_create(ucfirst($drv), "\x3c\77\x70\150\x70\x20\x63\x6c\x61\x73\163\x20" . $drv_class . "\40\x7b\x20\x7d", $this->ci_base_root, array("\154\151\x62\x72\x61\162\151\x65\163", $subdir)); $dir = "\x74\x65\163\x74\144\151\162"; $path = APPPATH . $dir . "\x2f"; $model = "\x41\x75\164\x6f\155\157\144"; $this->ci_vfs_create($model, "\74\77\160\x68\x70\x20\143\154\141\163\163\40" . $model . "\x20\145\x78\164\145\156\144\x73\40\103\x49\137\115\157\x64\145\154\x20\173\x20\175", $this->ci_app_root, array($dir, "\x6d\x6f\144\x65\154\x73")); $cfg = array("\x70\x61\143\153\x61\x67\x65\x73" => array($path), "\150\145\x6c\160\145\x72" => array($helper), "\x6c\x69\x62\162\x61\162\x69\x65\x73" => array($lib), "\x64\x72\151\x76\x65\x72\x73" => array($drv), "\x6d\157\144\145\154" => array($model), "\x63\157\156\146\151\x67" => array("\143\x6f\156\146\151\x67\x31", "\x63\157\156\146\151\x67\62")); $this->ci_vfs_create("\x61\165\164\157\154\x6f\x61\x64", "\x3c\77\x70\150\160\40\x24\x61\x75\164\x6f\x6c\157\141\144\x20\75\x20" . var_export($cfg, TRUE) . "\73", $this->ci_app_root, "\143\x6f\x6e\146\x69\147"); $this->load->initialize(); $this->assertContains($path, $this->load->get_package_paths()); $this->assertTrue(function_exists($hlp_func), $hlp_func . "\40\144\x6f\x65\x73\40\156\x6f\x74\40\x65\170\151\x73\164"); $this->assertTrue(class_exists($lib_class), $lib_class . "\x20\144\x6f\x65\163\x20\156\x6f\164\40\x65\x78\151\163\x74"); $this->assertObjectHasAttribute($lib, $this->ci_obj); $this->assertInstanceOf($lib_class, $this->ci_obj->{$lib}); $this->assertTrue(class_exists($drv_class), $drv_class . "\x20\x64\x6f\145\163\x20\156\157\x74\40\x65\x78\x69\163\x74"); $this->assertObjectHasAttribute($drv, $this->ci_obj); $this->assertInstanceOf($drv_class, $this->ci_obj->{$drv}); $this->assertTrue(class_exists($model), $model . "\40\144\157\x65\x73\x20\156\157\164\40\145\170\151\163\x74"); $this->assertObjectHasAttribute($model, $this->ci_obj); $this->assertInstanceOf($model, $this->ci_obj->{$model}); $this->assertEquals($cfg["\143\157\156\146\x69\x67"], $this->ci_obj->config->loaded); } }

Function Calls

None

Variables

None

Stats

MD5 1be5a30f5668dabf189b99625d0aa8df
Eval Count 0
Decode Time 205 ms