public static function fakeFor(callable $callable, array $eventsToFake = [])
    {
        $originalDispatcher = static::getFacadeRoot();

        static::fake($eventsToFake);

        return tap($callable(), function () use ($originalDispatcher) {
            static::swap($originalDispatcher);

            Model::setEventDispatcher($originalDispatcher);
        });
    }
public static function fakeFor(callable $callable, array $eventsToFake = [])
    {
        $originalDispatcher = static::getFacadeRoot();

        static::fake($eventsToFake);

        return tap($callable(), function () use ($originalDispatcher) {
            static::swap($originalDispatcher);

            Model::setEventDispatcher($originalDispatcher);
        });
    }
public static function fakeFor ( callable $ callable , array $ eventsToFake = [ ] ) { $ originalDispatcher = static :: getFacadeRoot ( ) ; static :: fake ( $ eventsToFake ) ; return tap ( $ callable ( ) , function ( ) use ( $ originalDispatcher ) { static :: swap ( $ originalDispatcher ) ; Model :: setEventDispatcher ( $ originalDispatcher ) ; } ) ; }
Replace the bound instance with a fake during the given callable's execution.

@param  callable  $callable
@param  array  $eventsToFake
@return callable
Replace the bound instance with a fake during the given callable s execution .