src/Concerns/MocksApplicationServices.php
protected function withoutNotifications()
    {
        $mock = Mockery::mock(NotificationDispatcher::class);

        $mock->shouldReceive('send')->andReturnUsing(function ($notifiable, $instance, $channels = []) {
            $this->dispatchedNotifications[] = compact(
                'notifiable', 'instance', 'channels'
            );
        });

        $this->app->instance(NotificationDispatcher::class, $mock);

        return $this;
    }
protected function withoutNotifications()
    {
        $mock = Mockery::mock(NotificationDispatcher::class);

        $mock->shouldReceive('send')->andReturnUsing(function ($notifiable, $instance, $channels = []) {
            $this->dispatchedNotifications[] = compact(
                'notifiable', 'instance', 'channels'
            );
        });

        $this->app->instance(NotificationDispatcher::class, $mock);

        return $this;
    }
protected function withoutNotifications ( ) { $ mock = Mockery :: mock ( NotificationDispatcher :: class ) ; $ mock -> shouldReceive ( 'send' ) -> andReturnUsing ( function ( $ notifiable , $ instance , $ channels = [ ] ) { $ this -> dispatchedNotifications [ ] = compact ( 'notifiable' , 'instance' , 'channels' ) ; } ) ; $ this -> app -> instance ( NotificationDispatcher :: class , $ mock ) ; return $ this ; }
Mock the notification dispatcher so all notifications are silenced.

@return $this
Mock the notification dispatcher so all notifications are silenced .