public function index() { $files = $this->storage->paginate(['parentId' => null]); return Presenter::make('storage.index', compact('files')); }
public function testPaginate() { list($handler, $repo, $auth, $keygen) = $this->getMocks(); $instance = new Storage($handler, $repo, $auth, $keygen); $paginator = m::mock('Illuminate\\Contracts\\Pagination\\LengthAwarePaginator'); $repo->shouldReceive('paginate')->once()->with(['var' => 'foo'], 10)->andReturn($paginator); $files = $instance->paginate(['var' => 'foo'], 10); $this->assertInstanceOf('Illuminate\\Contracts\\Pagination\\LengthAwarePaginator', $files); }