-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Use now
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 time
now
function to allow mock of timenow
function to allow mock of time
This comment was marked as resolved.
This comment was marked as resolved.
Yes, that is the best solution indeed |
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 a second way of accessing mocked date values.
now
function to allow mock of timenow
function to allow mock of time
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 | MIT Commits ------- 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 | Fix symfony/symfony#53531 (comment) | License | MIT Commits ------- 1cfd8b57e9 forward a Clock instance to the created InMemoryTransport
When doing functional testing there is not really a easy way to mock the time for the
InMemoryTransport
. It's created by theInMemoryTransportFactory
and you can't set which clock to use.