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

        $mock->shouldReceive('fire', 'dispatch', 'getCommandHandler')->andReturnUsing(function ($called) {
            $this->firedEvents[] = $called;
        });

        $this->app->instance('events', $mock);

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

        $mock->shouldReceive('fire', 'dispatch', 'getCommandHandler')->andReturnUsing(function ($called) {
            $this->firedEvents[] = $called;
        });

        $this->app->instance('events', $mock);

        return $this;
    }
protected function withoutEvents ( ) { $ mock = Mockery :: mock ( 'Illuminate\Contracts\Events\Dispatcher' ) ; $ mock -> shouldReceive ( 'fire' , 'dispatch' , 'getCommandHandler' ) -> andReturnUsing ( function ( $ called ) { $ this -> firedEvents [ ] = $ called ; } ) ; $ this -> app -> instance ( 'events' , $ mock ) ; return $ this ; }
Mock the event dispatcher so all events are silenced and collected.

@return $this
Mock the event dispatcher so all events are silenced and collected .