public function testGetLastId() { $coll = new ResourceCollection(); $coll->add(new Resource('test', 'FIRST_ID')); $coll->add(new Resource('test', 'LAST_ID')); $this->assertEquals('LAST_ID', $coll->getLastId()); }
private function toCollection(ResponseInterface $response, $method) { $data = $this->decode($response); $coll = new ResourceCollection($data['pagination']['previous_uri'], $data['pagination']['next_uri']); foreach ($data['data'] as $resource) { $coll->add($this->{$method}($resource)); } return $coll; }