src/Concerns/MocksApplicationServices.php
protected function expectsNotification($notifiable, $notification)
    {
        $this->withoutNotifications();

        $this->beforeApplicationDestroyed(function () use ($notifiable, $notification) {
            foreach ($this->dispatchedNotifications as $dispatched) {
                $notified = $dispatched['notifiable'];

                if (($notified === $notifiable ||
                     $notified->getKey() == $notifiable->getKey()) &&
                    get_class($dispatched['instance']) === $notification
                ) {
                    return $this;
                }
            }

            $this->fail('The following expected notification was not dispatched: ['.$notification.']');
        });

        return $this;
    }
protected function expectsNotification($notifiable, $notification)
    {
        $this->withoutNotifications();

        $this->beforeApplicationDestroyed(function () use ($notifiable, $notification) {
            foreach ($this->dispatchedNotifications as $dispatched) {
                $notified = $dispatched['notifiable'];

                if (($notified === $notifiable ||
                     $notified->getKey() == $notifiable->getKey()) &&
                    get_class($dispatched['instance']) === $notification
                ) {
                    return $this;
                }
            }

            $this->fail('The following expected notification was not dispatched: ['.$notification.']');
        });

        return $this;
    }
protected function expectsNotification ( $ notifiable , $ notification ) { $ this -> withoutNotifications ( ) ; $ this -> beforeApplicationDestroyed ( function ( ) use ( $ notifiable , $ notification ) { foreach ( $ this -> dispatchedNotifications as $ dispatched ) { $ notified = $ dispatched [ 'notifiable' ] ; if ( ( $ notified === $ notifiable || $ notified -> getKey ( ) == $ notifiable -> getKey ( ) ) && get_class ( $ dispatched [ 'instance' ] ) === $ notification ) { return $ this ; } } $ this -> fail ( 'The following expected notification was not dispatched: [' . $ notification . ']' ) ; } ) ; return $ this ; }
Specify a notification that is expected to be dispatched.

@param  mixed  $notifiable
@param  string  $notification
@return $this
Specify a notification that is expected to be dispatched .