Skip to content

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

Merged
taylorotwell merged 5 commits intolaravel:9.xfrom
mateusjunges:implement-except-on-fake-classes
Sep 13, 2022
Merged

[9.x] Implement except method for fake classes to define what should not be faked#44117
taylorotwell merged 5 commits intolaravel:9.xfrom
mateusjunges:implement-except-on-fake-classes

Conversation

@mateusjunges
Copy link
Copy Markdown
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
Copy Markdown
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