[Tests] Fix CI failures in TemplateLinterTest and invokable controller test#1796
Open
GromNaN wants to merge 1 commit into
Open
[Tests] Fix CI failures in TemplateLinterTest and invokable controller test#1796GromNaN wants to merge 1 commit into
GromNaN wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
TemplateLinterTestcases assert on verbose output fromwriteLinterMessage(), which is only printed when the output is verbose (-v). These tests were relying onSHELL_VERBOSITYbeing inherited from the PHPUnit parent process, but that inheritance is not guaranteed. Pass-vexplicitly torunMaker()in all three test cases.The
testControllerInvokabilityfixture was calling the invokable controller directly without a request in theRequestStack. After a recent update to the Flexbase.html.twigrecipe that accessesapp.request.server, this causedTwig\Error\RuntimeError: Impossible to access an attribute ("server") on a null variable. Push a syntheticRequestonto theRequestStackbefore invoking the controller soapp.requestis non-null.