src/Concerns/MocksApplicationServices.php
protected function withoutJobs()
    {
        $mock = Mockery::mock('Illuminate\Contracts\Bus\Dispatcher');

        $mock->shouldReceive('dispatch', 'dispatchNow', 'getCommandHandler')->andReturnUsing(function ($dispatched) {
            $this->dispatchedJobs[] = $dispatched;
        });

        $this->app->instance(
            'Illuminate\Contracts\Bus\Dispatcher', $mock
        );

        return $this;
    }
protected function withoutJobs()
    {
        $mock = Mockery::mock('Illuminate\Contracts\Bus\Dispatcher');

        $mock->shouldReceive('dispatch', 'dispatchNow', 'getCommandHandler')->andReturnUsing(function ($dispatched) {
            $this->dispatchedJobs[] = $dispatched;
        });

        $this->app->instance(
            'Illuminate\Contracts\Bus\Dispatcher', $mock
        );

        return $this;
    }
protected function withoutJobs ( ) { $ mock = Mockery :: mock ( 'Illuminate\Contracts\Bus\Dispatcher' ) ; $ mock -> shouldReceive ( 'dispatch' , 'dispatchNow' , 'getCommandHandler' ) -> andReturnUsing ( function ( $ dispatched ) { $ this -> dispatchedJobs [ ] = $ dispatched ; } ) ; $ this -> app -> instance ( 'Illuminate\Contracts\Bus\Dispatcher' , $ mock ) ; return $ this ; }
Mock the job dispatcher so all jobs are silenced and collected.

@return $this
Mock the job dispatcher so all jobs are silenced and collected .