Laravel\Lumen\Testing\TestCase::expectsJobs PHP Method

expectsJobs() protected method

These jobs will be mocked, so that handlers will not actually be executed.
protected expectsJobs ( array | string $jobs )
$jobs array | string
    protected function expectsJobs($jobs)
    {
        $jobs = is_array($jobs) ? $jobs : func_get_args();
        unset($this->app->availableBindings['Illuminate\\Contracts\\Bus\\Dispatcher']);
        $mock = Mockery::mock('Illuminate\\Bus\\Dispatcher[dispatch]', [$this->app]);
        foreach ($jobs as $job) {
            $mock->shouldReceive('dispatch')->atLeast()->once()->with(Mockery::type($job));
        }
        $this->app->instance('Illuminate\\Contracts\\Bus\\Dispatcher', $mock);
        return $this;
    }