Exemplo n.º 1
0
 /**
  * Build a request to get the next items of a paged list.
  *
  * @param PagedList $pagedList
  *
  * @return Request
  */
 private function buildRequestForPagedList(PagedList $pagedList)
 {
     $nextItemsUri = $pagedList->getNextUrl();
     $params = array();
     $components = parse_url($nextItemsUri);
     parse_str($components['query'], $params);
     $path = $components['path'];
     $versionPath = sprintf('/%s/', Authentication::API_VERSION);
     $versionPathLength = strlen($versionPath);
     $path = substr($path, $versionPathLength);
     return new Request('GET', $path, $params);
 }
Exemplo n.º 2
0
 public function test_it_returns_the_items()
 {
     $items = array(new User(), new User());
     $pagedList = new PagedList($items);
     $this->assertSame($items, $pagedList->items());
 }