summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-26 22:37:38 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-26 22:37:38 +0200
commitffe7938b8d6dfdbdac8a34008dbbb15d31de6080 (patch)
treed4ff613c67772d06f49b11634d18642e1334870e /tests
parenteb22d544c4ea1993fcbdad0404ce9ec65d0410be (diff)
parent8f490da4cb6ad4ffa2c75cfcbd0e7896cdb4cd8c (diff)
Merge pull request #1539 from toopay/test-suite
Allow extra SPL autoloader
Diffstat (limited to 'tests')
-rw-r--r--tests/mocks/autoloader.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index e3ff7a8bd..be1c2220c 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -69,16 +69,21 @@ function autoload($class)
}
}
- $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;
}