Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Messenger] Usenow function to allow mock of time#53531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
When doing functional testing there is not really a easy way to mock the time for the `InMemoryTransport`. It's created by the `InMemoryTransportFactory` and you can't set which clock to use.
now function to allow mock of timenow function to allow mock of timenow function to allow mock of timenow function to allow mock of time This comment was marked as resolved.
This comment was marked as resolved.
andersonamuller commentedJan 30, 2024
Yes, that is the best solution indeed |
derrabus left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't believe that this is the right way. If the transport already receives a clock, we should rather leverage the injected clock for mocking than introduce asecond way of accessing mocked date values.
now function to allow mock of timenow function to allow mock of timenicolas-grekas commentedApr 11, 2024
I'd rather fix this aspect indeed: making the InMemoryTransportFactory accept and forward a clock. PR welcome. |
…MemoryTransport (xabbuh)This PR was merged into the 7.1 branch.Discussion----------[Messenger] forward a Clock instance to the created InMemoryTransport| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | no| New feature? | yes| Deprecations? | no| Issues |Fix#53531 (comment)| License | MITCommits-------1cfd8b5 forward a Clock instance to the created InMemoryTransport
…MemoryTransport (xabbuh)This PR was merged into the 7.1 branch.Discussion----------[Messenger] forward a Clock instance to the created InMemoryTransport| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | no| New feature? | yes| Deprecations? | no| Issues |Fixsymfony/symfony#53531 (comment)| License | MITCommits-------1cfd8b57e9 forward a Clock instance to the created InMemoryTransport
Uh oh!
There was an error while loading.Please reload this page.
When doing functional testing there is not really a easy way to mock the time for the
InMemoryTransport. It's created by theInMemoryTransportFactoryand you can't set which clock to use.