Fix unit test in case no vendor/autoload.php take 3, a=chris
Fix unit test in case no vendor/autoload.php take 3, a=chris
diff --git a/tests/index.php b/tests/index.php
index 25b1a811a..242db6144 100644
--- a/tests/index.php
+++ b/tests/index.php
@@ -55,6 +55,12 @@ if (!C\PROFILE || !C\DISPLAY_TESTS) {
echo "BAD REQUEST";
exit();
}
+/** Catch errors as exceptions too*/
+function exception_error_handler($errno, $errstr, $errfile, $errline ) {
+ throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
+}
+set_error_handler("exception_error_handler");
+
/**
* NO_CACHE means don't try to use memcache
* @ignore
@@ -73,6 +79,7 @@ try {
} catch (Exception $e) {
C\nsdefine("BROWSER_TESTS", false);
}
+restore_error_handler();
if (isset($_REQUEST['activity']) &&
in_array($_REQUEST['activity'], $allowed_activities)) {
$activity = C\NS_TESTS . $_REQUEST['activity'];