Skip to content

[Tests] Fix CI failures in TemplateLinterTest and invokable controller test#1796

Open
GromNaN wants to merge 1 commit into
symfony:1.xfrom
GromNaN:fix/ci-test-failures-v2
Open

[Tests] Fix CI failures in TemplateLinterTest and invokable controller test#1796
GromNaN wants to merge 1 commit into
symfony:1.xfrom
GromNaN:fix/ci-test-failures-v2

Conversation

@GromNaN

@GromNaN GromNaN commented May 13, 2026

Copy link
Copy Markdown
Member

The TemplateLinterTest cases assert on verbose output from writeLinterMessage(), which is only printed when the output is verbose (-v). These tests were relying on SHELL_VERBOSITY being inherited from the PHPUnit parent process, but that inheritance is not guaranteed. Pass -v explicitly to runMaker() in all three test cases.

The testControllerInvokability fixture was calling the invokable controller directly without a request in the RequestStack. After a recent update to the Flex base.html.twig recipe that accesses app.request.server, this caused Twig\Error\RuntimeError: Impossible to access an attribute ("server") on a null variable. Push a synthetic Request onto the RequestStack before invoking the controller so app.request is non-null.

…r test

TemplateLinterTest asserts on verbose output from the linter, but
writeLinterMessage() is only called when the output is verbose. Pass
-v explicitly to runMaker() instead of relying on SHELL_VERBOSITY
being inherited from the PHPUnit parent process.

The invokable controller fixture was calling the controller directly
without a request in the RequestStack, causing Twig to crash on
app.request.server (null) after the Flex base.html.twig recipe update.
Push a synthetic Request onto the RequestStack before invoking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant