Skip to content

[9.x] Accept closure in bus assertion helpers #46075

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

Merged

Conversation

markwalet
Copy link
Contributor

This pr will allow the following assertion helpers to accept a closure instead of a class string when asserting dispatched jobs.

Bus::assertDispatchedTimes()
Bus::assertDispatchedSyncTimes()
Bus::assertDispatchedAfterResponseTimes()

Besides making it easier to assert if a job has been sent a specific amount of times based on a callback, it also improves consistency between these methods and the their normal (without times) counterparts.

If there is anything I need to do to improve testing or codestyle, please let me know. I'm happy to do any changes.

@taylorotwell taylorotwell merged commit b12d863 into laravel:9.x Feb 10, 2023
@GrahamCampbell GrahamCampbell changed the title Accept closure in bus assertion helpers [9.x] Accept closure in bus assertion helpers Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants