Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
andersonamuller wants to merge1 commit intosymfony:6.4fromandersonamuller:patch-8
Closed

[Messenger] Usenow function to allow mock of time#53531

andersonamuller wants to merge1 commit intosymfony:6.4fromandersonamuller:patch-8

Conversation

@andersonamuller
Copy link
Contributor

@andersonamullerandersonamuller commentedJan 12, 2024
edited by nicolas-grekas
Loading

QA
Branch?7.1
Bug fix?no
New feature?no
Deprecations?no
IssuesN/A
LicenseMIT

When doing functional testing there is not really a easy way to mock the time for theInMemoryTransport. It's created by theInMemoryTransportFactory and you can't set which clock to use.

kvrushifa reacted with thumbs up emoji
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.
@carsonbotcarsonbot added this to the6.4 milestoneJan 12, 2024
@andersonamullerandersonamuller changed the titleUsenow function to allow mock of time[Messenger] Usenow function to allow mock of timeJan 12, 2024
@carsonbotcarsonbot changed the title[Messenger] Usenow function to allow mock of timeUsenow function to allow mock of timeJan 30, 2024
@ro0NL

This comment was marked as resolved.

@andersonamuller
Copy link
ContributorAuthor

however i think we should inject global clock into InMemoryTransportFactory isnt it?

Yes, that is the best solution indeed

Copy link
Member

@derrabusderrabus left a 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.

xabbuh, andersonamuller, and andrew-demb reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas modified the milestones:6.4,7.1Apr 11, 2024
@nicolas-grekasnicolas-grekas changed the titleUsenow function to allow mock of time[Messenger] Usenow function to allow mock of timeApr 11, 2024
@nicolas-grekas
Copy link
Member

It's created by the InMemoryTransportFactory and you can't set which clock to use.

I'd rather fix this aspect indeed: making the InMemoryTransportFactory accept and forward a clock.

PR welcome.

fabpot added a commit that referenced this pull requestApr 17, 2024
…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
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull requestApr 17, 2024
…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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus requested changes

+1 more reviewer

@ro0NLro0NLro0NL approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

7.1

Development

Successfully merging this pull request may close these issues.

5 participants

@andersonamuller@ro0NL@nicolas-grekas@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp