public function testConstructWithEmptyData() { $collection = new Collection(); $this->assertEmpty($collection->getData()); $this->assertEquals(function () { }, $collection->getTransformer()); }
/** * Paginates the collection response. * * @param $paginationEnabled * * @throws \InvalidArgumentException */ protected function paginate($paginationEnabled) { if ($paginationEnabled) { if (!$this->content instanceof Paginator) { throw new \InvalidArgumentException(); } $this->paginator->setupPaginator($this->content); $this->collection->setPaginator($this->paginator); } }