MocksApplicationServices
Properties
$firedEvents array
All of the fired events.
$firedModelEvents array
All of the fired model events.
$dispatchedJobs array
All of the dispatched jobs.
$dispatchedNotifications array
All of the dispatched notifications.
Methods
expectsEvents ( $events ) : $this
Specify a list of events that should be fired for the given operation.
Parameters
- $events array|string
doesntExpectEvents ( $events ) : $this
Specify a list of events that should not be fired for the given operation.
Parameters
- $events array|string
withoutEvents ( ) : $this
Mock the event dispatcher so all events are silenced and collected.
getFiredEvents ( array $events ) : array
Filter the given events against the fired events.
Parameters
- $events array
expectsJobs ( $jobs ) : $this
Specify a list of jobs that should be dispatched for the given operation.
Parameters
- $jobs array|string
doesntExpectJobs ( $jobs ) : $this
Specify a list of jobs that should not be dispatched for the given operation.
Parameters
- $jobs array|string
withoutJobs ( ) : $this
Mock the job dispatcher so all jobs are silenced and collected.
getDispatchedJobs ( array $jobs ) : array
Filter the given jobs against the dispatched jobs.
Parameters
- $jobs array
getDispatched ( array $classes , array $dispatched ) : array
Filter the given classes against an array of dispatched classes.
Parameters
- $classes array
- $dispatched array
wasDispatched ( $needle , array $haystack ) : bool
Check if the given class exists in an array of dispatched classes.
Parameters
- $needle string
- $haystack array
withoutNotifications ( ) : $this
Mock the notification dispatcher so all notifications are silenced.
expectsNotification ( $notifiable , $notification ) : $this
Specify a notification that is expected to be dispatched.
Parameters
- $notifiable mixed
- $notification string