From 9765472d1388c631ad57f4bd0dd4dd424f79e5e0 Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Mon, 13 Jan 2014 14:48:22 -0800 Subject: 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. --- tests/mocks/autoloader.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'tests/mocks/autoloader.php') 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); -- cgit v1.2.3-24-g4f1b