コード例 #1
0
 function it_throws_exception_when_can_not_fetch_response_using_http_client(ApiHttpClientInterface $apiHttpClient)
 {
     $apiHttpClient->get(Argument::type(ApiHttpPathAndQuery::class))->willThrow(ApiHttpClientException::class);
     $this->shouldThrow(CouldNotFetchResourceRepositoryException::class)->duringFindByIds(FindByIdsParameters::createForPublicationIdAndArticleIds(PublicationId::SA, [self::ARTICLE_ID]));
     $this->shouldThrow(CouldNotFetchResourceRepositoryException::class)->duringFind(FindParameters::createForPublicationIdAndArticleId(PublicationId::SA, self::ARTICLE_ID));
     $this->shouldThrow(CouldNotFetchResourceRepositoryException::class)->duringFindByChangelog(FindByChangelogParameters::createForPublicationId(PublicationId::SA));
     $this->shouldThrow(CouldNotFetchResourceRepositoryException::class)->duringFindBySections(FindBySectionParameters::createForPublicationIdAndSections(PublicationId::SA, [self::SECTION_NAME]));
 }
コード例 #2
0
 /**
  * @param FindParametersInterface $findParameters
  *
  * @return mixed
  * @throws ApiHttpClientException
  */
 private function makeHttpGetRequest(FindParametersInterface $findParameters)
 {
     return $this->httpClient->get($findParameters->buildApiHttpPathAndQuery());
 }
コード例 #3
0
 function it_throws_exception_when_can_not_fetch_response_using_http_client(ApiHttpClientInterface $apiHttpClient)
 {
     $apiHttpClient->get(Argument::type(ApiHttpPathAndQuery::class))->willThrow(ApiHttpClientException::class);
     $this->shouldThrow(CouldNotFetchResourceRepositoryException::class)->duringFindAll(FindAllParameters::createForPublicationId(PublicationId::SA));
 }