Skip to content

fix: detect Symfony 7.4+ exception pages - #197

Merged
kbond merged 1 commit into
zenstruck:1.xfrom
kbond:exception-page-symfony-7.4
Aug 11, 2026
Merged

fix: detect Symfony 7.4+ exception pages#197
kbond merged 1 commit into
zenstruck:1.xfrom
kbond:exception-page-symfony-7.4

Conversation

@kbond

@kbond kbond commented Aug 11, 2026

Copy link
Copy Markdown
Member

Session::ensureNoException() scraped the exception page with .trace-details .trace-class and .exception-message-wrapper .exception-message. Symfony 7.4 renders exceptions with var-dumper instead, and under the CLI SAPI that output isn't even html:

Zenstruck\Browser\Tests\Fixture\CustomException {#4853 #message: "exception thrown" …

Both selectors matched nothing, so the method returned early and fails_if_trying_to_manipulate_exception_page could only be marked incomplete on 7.4+. The old path is kept for < 7.4, the dump format is now recognised alongside it, and the guard on the test is gone.

The status check moved to the top as a side effect: an exception page always carries a 4xx/5xx, and this runs before every action and assertion, so successful responses are no longer inspected at all. It falls through when a driver cannot report a status (Panther throws), preserving the old behaviour there.

Verified on Symfony 8.1.4 and 6.4.43 — the test passes with 12 assertions on each.

7.4 renders exceptions with `var-dumper` instead of the html trace page, so the css selectors matched nothing and `ensureNoException()` returned early.
@kbond
kbond merged commit 9394362 into zenstruck:1.x Aug 11, 2026
38 checks passed
@kbond
kbond deleted the exception-page-symfony-7.4 branch August 11, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant