summaryrefslogtreecommitdiffstats
path: root/tests/mocks
diff options
context:
space:
mode:
authorFred Emmott <fredemmott@fb.com>2014-01-13 23:48:22 +0100
committerFred Emmott <fredemmott@fb.com>2014-01-13 23:57:49 +0100
commit9765472d1388c631ad57f4bd0dd4dd424f79e5e0 (patch)
tree7a575c27c6203113baa56db3858833e86f374a60 /tests/mocks
parent4e6c5281a3258b3ff530a43580d1b8dc8e34dd59 (diff)
Don't throw in mock autoloader
This behavior doesn't appear to be used at all. This fixes HHVM compatibility: HHVM optimizes class_exists() to a dedicated bytecode - as it's not a function call, it doesn't show up in the backtrace. 100% of the tests pass with this change.
Diffstat (limited to 'tests/mocks')
-rw-r--r--tests/mocks/autoloader.php16
1 files changed, 1 insertions, 15 deletions
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index 3d216da1f..cc0a2e2f7 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -89,21 +89,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);