-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functional tests fail when NotFoundHttpException is thrown #25311
Comments
There is no default Wondering if there should be some lightweight alternative by default? |
Yes, it looks like Twig solves a part of it. After adding Twig the tests pass, but I get an error in the output:
edit: Also, I am not sure why am I seeing the shebang line in the output. |
Shouldn't we add one in the FrameworkBundle? 🤔 @nicolas-grekas @javiereguiluz |
After thinking about it, the behavior actually makes sense. If there is no templating engine you can not define error pages to be displayed so the FW doesn't know what to return in that case. But the issue of showing the error in the output of phpunit after adding templating still remains. |
But there could maybe be a default listener that returns a response with the correct status code and a body (depending on
That seems to be logger output? |
I agree on the response with the default status code. The body should probably be something like this:
with the correct response code in the headers. Regarding the logger output, I tried changing the
|
You can silence the output during tests by setting the |
Yes, I did set it to I also tried changing that number but I didn't find what are the available options and there meanings for the |
Setting it to |
Hi guys, do you have some update here? I have the issue here, and for some reason when I try to run the tests isolating the processes I get it as an invalid test. php bin/phpunit --process-isolation |
Seems same as #25844 |
@nicolas-grekas this was fixed by #26138 ? 😊 |
When I am running functional tests that extend WebTestCase and I request a controller action that throws a NotFoundHttpException it looks like the exception is not converted to u 404 response. (I am checking for a 404 response code in the test).
If I return a response from the controller:
then the tests pass.
I have create a minimal example here.
The text was updated successfully, but these errors were encountered: