public function testCanSetAndGetTheLimit() { $this->assertSame(20, $this->query->limit()); $this->assertSame($this->query, $this->query->limit(10)); $this->assertSame(10, $this->query->limit()); }
/** * Get the available resource groups * * @param Query $query An optional query object * @return Model */ public function getResourceGroups(Query $query = null) { if (!$query) { $query = new Query(); } return $this->getCommand('GetResourceGroups', array('page' => $query->page(), 'limit' => $query->limit()))->execute(); }
public function testCanGetResourceGroupsUsingAQueryObject() { $this->setMockResponse($this->client, 'groups_get'); $query = new Query(); $query->page(2)->limit(5); $response = $this->client->getResourceGroups($query); $requests = $this->getMockedRequests(); $request = $requests[0]; $this->assertSame('http://imbo/groups.json?page=2&limit=5&accessToken=2e1f640dc7e72e17703957dfb773f3cc58423df28fe97c481f702da2b50ddfe9', urldecode($request->getUrl())); }