fix(error): harden logging, i18n, a11y and handler tests
This commit is contained in:
@@ -40,8 +40,10 @@ final class ErrorHandler
|
||||
self::$reservedMemory = null;
|
||||
|
||||
// Discard any partial output from the failed request.
|
||||
while (ob_get_level() > 0) {
|
||||
ob_end_clean();
|
||||
if (!self::isPhpUnitRuntime()) {
|
||||
while (ob_get_level() > 0) {
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
|
||||
// Set HTTP 500 if no error status has been set yet.
|
||||
@@ -187,4 +189,9 @@ final class ErrorHandler
|
||||
echo "\n" . $exception->getMessage() . "\n" . $exception->getTraceAsString() . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
private static function isPhpUnitRuntime(): bool
|
||||
{
|
||||
return defined('PHPUNIT_COMPOSER_INSTALL') || defined('__PHPUNIT_PHAR__');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user