public function countExecutions(RequestBuilder $requestBuilder)
    {
        $expectation = $requestBuilder->build();
        $expectation->setResponse(new Response());
        $uri = $this->createBaseUri()->withPath(self::API_EXECUTIONS_URL);

        $request = (new PsrRequest())
            ->withUri($uri)
            ->withMethod('post')
            ->withHeader('Content-Type', 'application/json')
            ->withBody(new StringStream(json_encode($expectation)));

        $response = $this->connection->send($request);

        if (200 === $response->getStatusCode()) {
            $json = json_decode($response->getBody()->__toString());

            return $json->count;
        }

        $this->checkErrorResponse($response);
    }
public function countExecutions(RequestBuilder $requestBuilder)
    {
        $expectation = $requestBuilder->build();
        $expectation->setResponse(new Response());
        $uri = $this->createBaseUri()->withPath(self::API_EXECUTIONS_URL);

        $request = (new PsrRequest())
            ->withUri($uri)
            ->withMethod('post')
            ->withHeader('Content-Type', 'application/json')
            ->withBody(new StringStream(json_encode($expectation)));

        $response = $this->connection->send($request);

        if (200 === $response->getStatusCode()) {
            $json = json_decode($response->getBody()->__toString());

            return $json->count;
        }

        $this->checkErrorResponse($response);
    }
public function countExecutions ( RequestBuilder $ requestBuilder ) { $ expectation = $ requestBuilder -> build ( ) ; $ expectation -> setResponse ( new Response ( ) ) ; $ uri = $ this -> createBaseUri ( ) -> withPath ( self :: API_EXECUTIONS_URL ) ; $ request = ( new PsrRequest ( ) ) -> withUri ( $ uri ) -> withMethod ( 'post' ) -> withHeader ( 'Content-Type' , 'application/json' ) -> withBody ( new StringStream ( json_encode ( $ expectation ) ) ) ; $ response = $ this -> connection -> send ( $ request ) ; if ( 200 === $ response -> getStatusCode ( ) ) { $ json = json_decode ( $ response -> getBody ( ) -> __toString ( ) ) ; return $ json -> count ; } $ this -> checkErrorResponse ( $ response ) ; }
Counts the amount of times a request was executed in phiremock.

@param \Mcustiel\Phiremock\Client\Utils\RequestBuilder $requestBuilder

@return int
Counts the amount of times a request was executed in phiremock .