Flugg\Responder\Tests\TestCase::mockBuilder PHP Method

mockBuilder() protected method

Create a mock of the Eloquent builder with a mock of the [get] method which returns the given data.
protected mockBuilder ( array $data = null ) : Mockery\MockInterface
$data array
return Mockery\MockInterface
    protected function mockBuilder(array $data = null)
    {
        $builder = Mockery::spy(EloquentBuilder::class);
        $builder->shouldReceive('get')->andReturn(collect($data));
        return $builder;
    }