summaryrefslogtreecommitdiffstats
path: root/tests/mocks/autoloader.php
diff options
context:
space:
mode:
authorJonathon Hill <jhill@brandmovers.com>2012-11-12 14:51:41 +0100
committerJonathon Hill <jhill@brandmovers.com>2012-11-12 14:51:41 +0100
commit3978fc33d82dd7f778d1adbf30744f4dfac41c25 (patch)
treef32be1ae610f0cfeff65c35abecd14e8ea5cadc6 /tests/mocks/autoloader.php
parent275cf274860c6ed181d50b398efd3a21d7ba9135 (diff)
parenta9ab46d7a031bda304eb9b6658ffaf693b8d9bcb (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Conflicts: user_guide_src/source/changelog.rst Signed-off-by: Jonathon Hill <jhill@brandmovers.com>
Diffstat (limited to 'tests/mocks/autoloader.php')
-rw-r--r--tests/mocks/autoloader.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index 5b202f159..3d216da1f 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -16,7 +16,7 @@ function autoload($class)
$ci_core = array(
'Benchmark', 'Config', 'Controller',
'Exceptions', 'Hooks', 'Input',
- 'Lang', 'Loader', 'Model',
+ 'Lang', 'Loader', 'Log', 'Model',
'Output', 'Router', 'Security',
'URI', 'Utf8',
);
@@ -25,11 +25,10 @@ function autoload($class)
'Calendar', 'Cart', 'Driver_Library',
'Email', 'Encrypt', 'Form_validation',
'Ftp', 'Image_lib', 'Javascript',
- 'Log', 'Migration', 'Pagination',
- 'Parser', 'Profiler', 'Table',
- 'Trackback', 'Typography', 'Unit_test',
- 'Upload', 'User_agent', 'Xmlrpc',
- 'Zip',
+ 'Migration', 'Pagination', 'Parser',
+ 'Profiler', 'Table', 'Trackback',
+ 'Typography', 'Unit_test', 'Upload',
+ 'User_agent', 'Xmlrpc', 'Zip'
);
$ci_drivers = array(
@@ -38,13 +37,11 @@ function autoload($class)
if (strpos($class, 'Mock_') === 0)
{
- $class = str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class);
- $class = strtolower($class);
+ $class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class));
}
elseif (strpos($class, 'CI_') === 0)
{
- $fragments = explode('_', $class, 2);
- $subclass = next($fragments);
+ $subclass = substr($class, 3);
if (in_array($subclass, $ci_core))
{
@@ -88,7 +85,7 @@ function autoload($class)
}
}
- $file = (isset($file)) ? $file : $dir.$class.'.php';
+ $file = isset($file) ? $file : $dir.$class.'.php';
if ( ! file_exists($file))
{