#643: Fix cache control expression Symfony DI configuration #644
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.
This PR fixes #643.
As described in #643, there are 2 issues with the current Extension configuration, when defined as follows:
match_response
option, we get the following Container compile-time error:match_response_expression_service
, we get an error that such option doesn't exist for the Extension. Seemsexpression_language
should be used (as the Extension Configuration would suggest).In both cases fixed
replaceArgument
to besetArgument
. The former way worked in Symfony 5, but doesn't work in Symfony 6+.The 1st issue occurs only at compile-time, therefore existing Extension tests configuring
match_response
wouldn't surface the issue as the definition structure is correct. Seems Symfony now processes those differently at compile time.I added
testContainerCompilesWithCacheControlExpressionConfig
which compiles the container and performs no other assertions. We can see the mentioned error on the current state of the3.x
branch when running that test.There's no coverage for 2nd argument, so I added
testConfigLoadCacheControlExpressionWithOverriddenExpressionLanguage
test.Side note: Alternatively, adding the above options to
./tests/Functional/Fixtures/app/config/config.yml
config, would also uncover the bug when running anyKernelTestCase
test as those actually compile the container as well.