summaryrefslogtreecommitdiffstats
path: root/tests/mocks/autoloader.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mocks/autoloader.php')
-rw-r--r--tests/mocks/autoloader.php69
1 files changed, 39 insertions, 30 deletions
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index 3d216da1f..33942768d 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -14,26 +14,49 @@ function autoload($class)
$dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR;
$ci_core = array(
- 'Benchmark', 'Config', 'Controller',
- 'Exceptions', 'Hooks', 'Input',
- 'Lang', 'Loader', 'Log', 'Model',
- 'Output', 'Router', 'Security',
- 'URI', 'Utf8',
+ 'Benchmark',
+ 'Config',
+ 'Controller',
+ 'Exceptions',
+ 'Hooks',
+ 'Input',
+ 'Lang',
+ 'Loader',
+ 'Log',
+ 'Model',
+ 'Output',
+ 'Router',
+ 'Security',
+ 'URI',
+ 'Utf8'
);
$ci_libraries = array(
- 'Calendar', 'Cart', 'Driver_Library',
- 'Email', 'Encrypt', 'Form_validation',
- 'Ftp', 'Image_lib', 'Javascript',
- 'Migration', 'Pagination', 'Parser',
- 'Profiler', 'Table', 'Trackback',
- 'Typography', 'Unit_test', 'Upload',
- 'User_agent', 'Xmlrpc', 'Zip'
+ 'Calendar',
+ 'Cart',
+ 'Driver_Library',
+ 'Email',
+ 'Encrypt',
+ 'Encryption',
+ 'Form_validation',
+ 'Ftp',
+ 'Image_lib',
+ 'Javascript',
+ 'Migration',
+ 'Pagination',
+ 'Parser',
+ 'Profiler',
+ 'Table',
+ 'Trackback',
+ 'Typography',
+ 'Unit_test',
+ 'Upload',
+ 'User_agent',
+ 'Xmlrpc',
+ 'Zip'
);
- $ci_drivers = array(
- 'Session',
- );
+ $ci_drivers = array('Session', 'Cache');
if (strpos($class, 'Mock_') === 0)
{
@@ -89,21 +112,7 @@ function autoload($class)
if ( ! file_exists($file))
{
- $trace = debug_backtrace();
-
- if ($trace[2]['function'] === 'class_exists' OR $trace[2]['function'] === 'file_exists')
- {
- // If the autoload call came from `class_exists` or `file_exists`,
- // we skipped and return FALSE
- return FALSE;
- }
- elseif (($autoloader = spl_autoload_functions()) && end($autoloader) !== __FUNCTION__)
- {
- // If there was other custom autoloader, passed away
- return FALSE;
- }
-
- throw new InvalidArgumentException("Unable to load {$class}.");
+ return FALSE;
}
include_once($file);