You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing an array of event types to fake to the Event facade's fake() method the list of events in the array are executed normally while the unlisted events are faked. Based on the name of the parameter '$eventsToFake' I would expect the opposite behavior.
The origin of the problem appears to come from the Illuminate\Support\Testing\Fakes\EventFake class's shouldFakeEvent() method.
In this method the following statement returns true if the event is not in the list of events to fake:
Description:
When passing an array of event types to fake to the Event facade's fake() method the list of events in the array are executed normally while the unlisted events are faked. Based on the name of the parameter '$eventsToFake' I would expect the opposite behavior.
The origin of the problem appears to come from the Illuminate\Support\Testing\Fakes\EventFake class's shouldFakeEvent() method.
In this method the following statement returns true if the event is not in the list of events to fake:
I believe the result should be inverted:
Steps To Reproduce:
Call the Event::fake([SomeEvent::class]). At the moment the real handler for the SomeEvent class would be executed rather than the event being faked.
The text was updated successfully, but these errors were encountered: