MDL-52284 core: compatibility with Exception/Throwable changes in PHP7
This commit is contained in:
@@ -88,7 +88,13 @@ abstract class advanced_testcase extends base_testcase {
|
||||
trigger_error('Unexpected debugging() call detected.', E_USER_NOTICE);
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
} catch (Exception $ex) {
|
||||
$e = $ex;
|
||||
} catch (Throwable $ex) {
|
||||
$e = $ex; // PHP7.
|
||||
}
|
||||
|
||||
if (isset($e)) {
|
||||
// cleanup after failed expectation
|
||||
self::resetAllData();
|
||||
throw $e;
|
||||
|
||||
Reference in New Issue
Block a user