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

[9.x] Implement except method for fake classes to define what should not be faked #44117

Merged
merged 5 commits into from
Sep 13, 2022
Merged

[9.x] Implement except method for fake classes to define what should not be faked #44117

merged 5 commits into from
Sep 13, 2022

Conversation

mateusjunges
Copy link
Contributor

This PR is a follow up on #44106 and implements the same except method for the Event and Queue fake classes.

@jasonmccreary I'd appreciate your thoughts here 😃

@mateusjunges mateusjunges changed the title Implement except method for fake classes to define what should not be faked [9.x] Implement except method for fake classes to define what should not be faked Sep 13, 2022
@jasonmccreary
Copy link
Contributor

Awesome. I needed this the other week when testing a job dispatched another job. I wanted to actually dispatch that job in my test, but then fake anything else. Having Queue::fake()->except(JobImTesting::class) would have been awesome, instead of my hack of (new JobImTesting)->handle();. 👍

@mateusjunges mateusjunges marked this pull request as ready for review September 13, 2022 17:09
@taylorotwell taylorotwell merged commit 7996b8a into laravel:9.x Sep 13, 2022
@mateusjunges mateusjunges deleted the implement-except-on-fake-classes branch September 13, 2022 19:47
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.

3 participants