/** * Tags version with specific name * * @param string $consumerName * @param string $version * @param string $tagName * * @return \Psr\Http\Message\ResponseInterface */ public function tagVersion($consumerName, $version, $tagName) { $request = $this->requestBuilder->createTagVersionRequest($this->baseUrl, $consumerName, $version, $tagName); $response = $this->client->sendRequest($request); $this->checkIfResponseIsCorrect($response); return $response; }
function it_should_throw_exception_while_tagging_if_error_response(RequestInterface $request, ResponseInterface $response, StreamInterface $stream) { $consumerName = 'consumerA'; $version = '1.0.0'; $tagName = 'prod'; $this->requestBuilder->createTagVersionRequest($this->baseUrl, $consumerName, $version, $tagName)->willReturn($request); $this->client->sendRequest($request)->willReturn($response); $response->getStatusCode()->willReturn(500); $response->getBody()->willReturn($stream); $stream->getContents()->willReturn('Error'); $this->shouldThrow(PactBrokerException::class)->during('tagVersion', [$consumerName, $version, $tagName]); }