HTML pages of exceptions are different since Symfony 7.4? #62610
-
ContextExample 1I have this code in a controller: $site = $siteRepository
->findOneBy([
'apiSiteParameter' => $api_site_parameter,
])
;
if (!$site instanceof Site) {
throw $this->createNotFoundException('No site found');
}I tested this exception with something like this: // the database is empty
$this->testClient->request('GET', '/badges/fooooo');
self::assertPageTitleContains('No badge found (404 Not Found)');But after I upgraded to Symfony 7.4.0, I can’t test the Example 2It’s also visible in this PHPUnit test: https://github.com/liip/LiipFunctionalTestBundle/actions/runs/19837319935/job/56837621771 There is a test controller that do only this: And before Symfony 7.4, I had to add extra code to cover this case: QuestionWhat commit, PR, etc. changed this behaviour? I tried to search for HTTP and exceptions in https://github.com/symfony/symfony/blob/7.4/CHANGELOG-7.4.md and https://github.com/symfony/symfony/blob/7.4/UPGRADE-7.4.md but I’m probably missing the right keyword. Can the old behaviour be restored with some conf? So far, it looks like it’s due to the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
It may be related to:
Here is a workaround: put this in <php>
<env name="APP_RUNTIME_MODE" value="web=1"/>
</php>
|
Beta Was this translation helpful? Give feedback.
It may be related to:
Here is a workaround: put this in
phpunit.xml.distto restore the previous behaviour: