Skip to content
\n

I tested this exception with something like this:

\n
// the database is empty\n\n$this->testClient->request('GET',  '/badges/fooooo');\n\nself::assertPageTitleContains('No badge found (404 Not Found)');
\n

But after I upgraded to Symfony 7.4.0, I can’t test the <title> anymore, I replaced it with self::assertResponseStatusCodeSame(404); because the <title> wasn’t available anymore.

\n

Example 2

\n

It’s also visible in this PHPUnit test: https://github.com/liip/LiipFunctionalTestBundle/actions/runs/19837319935/job/56837621771

\n

There is a test controller that do only this: throw new \\Exception('foo');

\n

And before Symfony 7.4, foo was visible in <title>. Now the error page returns a text stack trace instead of a HTML page.

\n

I had to add extra code to cover this case:

\n\n
\n

Question

\n

What 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.

\n

Can the old behaviour be restored with some conf?

\n

So far, it looks like it’s due to the VarDumper component but it can’t find more information.

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

It may be related to:

\n\n

Here is a workaround: put this in phpunit.xml.dist to restore the previous behaviour:

\n
  <php>\n    <env name=\"APP_RUNTIME_MODE\" value=\"web=1\"/>\n  </php>
\n","upvoteCount":1,"url":"https://github.com/symfony/symfony/discussions/62610#discussioncomment-15129314"}}}
Discussion options

You must be logged in to vote

It may be related to:

Here is a workaround: put this in phpunit.xml.dist to restore the previous behaviour:

  <php>
    <env name="APP_RUNTIME_MODE" value="web=1"/>
  </php>
  • #58070 → the source of the change?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexislefebvre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant