Skip to content
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

[11.x] Access dispatchedBatches via BusFake #52270

Merged

Conversation

gdebrauwer
Copy link
Contributor

The QueueFake class has a pushedJobs() method that returns all the pushed jobs. The NotificationFake class has a sentNotifications method that returns all sent notifications. This PR adds a dispatchedBatches() method to the BusFake class which does the same for batches.

Why? In some tests in a project, I needed to inspect 'catch' and 'finally' closures of a batch and the ability to execute those closures to test their behavior. There is currently no easy way to do that because there is no easy way to access the dispatched batches. This PR fixes that.

@taylorotwell taylorotwell merged commit 6f1a721 into laravel:11.x Jul 26, 2024
31 checks passed
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.

None yet

2 participants