tests: ensure a lifetime configured in userland is used by the helper#360
Open
Amoifr wants to merge 1 commit into
Open
tests: ensure a lifetime configured in userland is used by the helper#360Amoifr wants to merge 1 commit into
Amoifr wants to merge 1 commit into
Conversation
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.
Closes #317.
Adds an integration test covering what the issue asks for: when an app overrides
lifetimein its bundle config, that value is the one the helper actually ends up with.The helper is a private service, so the test autowires it into a small public holder (same trick as
ResetPasswordInterfaceAutowireTest), boots a kernel withlifetime: 9999, and assertsgetTokenLifetime(). A second test pins the3600default, so both directions are locked.I checked it isn't a test that can't fail: hardcoding
$helperDefinition->replaceArgument(3, 3600)in the extension makes the userland test fail withFailed asserting that 3600 is identical to 9999, while the default one stays green.Full suite: 92 tests, 147 assertions, green (90 before).
One thing worth your call, @jrushlow: the issue is prefixed
[2.x], but I targetedmain. The2.xbranch hasn't moved since August 2024 and has drifted structurally (src/DependencyInjection/SymfonyCastsResetPasswordExtension.phpdoesn't even exist there anymore), while the wiring the issue is about is alive and well onmain. Happy to retarget or port it if you'd rather have it on2.x.Thanks for the bundle — it's one of those things that quietly saves everyone a week of fiddling with token hashing. 🙂