Merge pull request #1539 from toopay/test-suite
Allow extra SPL autoloader
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index e3ff7a8..be1c222 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -69,16 +69,21 @@
}
}
- $file = isset($file) ? $file : $dir.$class.'.php';
+ $file = (isset($file)) ? $file : $dir.$class.'.php';
if ( ! file_exists($file))
{
$trace = debug_backtrace();
- // If the autoload call came from `class_exists` or `file_exists`,
- // we skipped and return FALSE
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;
}