Removed @throws tags from IntegrationTestTrait http methods#14549
Removed @throws tags from IntegrationTestTrait http methods#14549
Conversation
| * | ||
| * @param string|array $url The URL to request. | ||
| * @return void | ||
| * @throws \PHPUnit\Framework\Error\Error|\Throwable |
There was a problem hiding this comment.
But this is not really correct, see my intial Comments on the original pr.
There was a problem hiding this comment.
As soon as you disableErrorHandlerMiddleware() you can actually expect the \Throwable at least.
| } catch (DatabaseException $e) { | ||
| throw $e; | ||
| } catch (LogicException $e) { | ||
| } catch (PhpUnitError | DatabaseException | LogicException $e) { |
There was a problem hiding this comment.
PHPUnit\Framework\Error\Error as PhpUnitError only catches PHP errors/warning/notices.
\PHPUnit\Framework\Exception class or \PHPUnit\Exception interface would be better as it would catch re-throw all PHPUnit asserts too.
There was a problem hiding this comment.
This is a great approach! Well done.
There was a problem hiding this comment.
I don't think we want to catch phpunit assertion errors here though.
There was a problem hiding this comment.
I wanted to say "it should re-throw all PHPUnit asserts".
Currently they are catched in \Throwable block and rendered by ExceptionRenderer.
|
So, do we need to revert this? |
Ensure app's error handler is not invoked for PHPUnit errors. Refs #14549
Ensure app's error handler is not invoked for PHPUnit errors. Refs #14549
Alternative to #14193