function its_method_get_packges_should_return_a_resource_collection(ApiClientInterface $client, Request $request)
 {
     $parameters = new RequestParameters();
     $parameters->setStartDate('1970-01-01');
     $request = $this->getNewRequest(ContentApiSdk::SUPERDESK_ENDPOINT_PACKAGES, $parameters);
     $client->makeApiCall($request)->willReturn('{ "_links": { "parent": { "title": "home", "href": "/" }, "self": { "title": "items", "href": "items?start_date=2015-08-01" } }, "_items": [], "_meta": { "page": 1, "total": 0, "max_results": 25 } }');
     $this->getPackages($parameters)->shouldReturnAnInstanceOf('Superdesk\\ContentApiSdk\\Api\\Pagerfanta\\ResourceCollection');
 }
 /**
  * Get package by identifier.
  *
  * @param string $packageId Package identifier
  * @param bool   $resolveAssociations Inject full associations recursively
  *                                    instead of references by uri.
  *
  * @return Package
  */
 public function getPackage($packageId, $resolveAssociations = false)
 {
     $request = $this->getNewRequest(sprintf('%s/%s', self::SUPERDESK_ENDPOINT_PACKAGES, $packageId));
     $response = $this->client->makeApiCall($request);
     $package = new Package($response->getResources());
     // This can be removed once the API fully supports retrieving package associations
     if ($resolveAssociations) {
         $associations = $this->getAssociationsFromPackage($package);
         $package = $this->injectAssociations($package, $associations);
     }
     return $package;
 }
 /**
  * Make call HTTP call.
  *
  * @return \Superdesk\ContentApiSdk\API\Response API Response object
  */
 private function doCall(RequestInterface $request)
 {
     return $this->client->makeApiCall($request);
 }