Beispiel #1
0
 /**
  * @param array  $parameters List of parameters
  * @param string $fetch      Fetch mode (object or response)
  *
  * @return \Psr\Http\Message\ResponseInterface
  */
 public function testReferenceResponse($parameters = [], $fetch = self::FETCH_OBJECT)
 {
     $queryParam = new QueryParam();
     $url = '/test-query';
     $url = $url . ('?' . $queryParam->buildQueryString($parameters));
     $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
     $body = $queryParam->buildFormDataString($parameters);
     $request = $this->messageFactory->createRequest('GET', $url, $headers, $body);
     $promise = $this->httpClient->sendAsyncRequest($request);
     if (self::FETCH_PROMISE === $fetch) {
         return $promise;
     }
     $response = $promise->wait();
     return $response;
 }
Beispiel #2
0
 /**
  * @param array  $parameters List of parameters
  * @param string $fetch      Fetch mode (object or response)
  *
  * @return \Psr\Http\Message\ResponseInterface
  */
 public function producesTriggersAcceptBeingSet($parameters = [], $fetch = self::FETCH_OBJECT)
 {
     $queryParam = new QueryParam();
     $url = '/test-object';
     $url = $url . ('?' . $queryParam->buildQueryString($parameters));
     $headers = array_merge(['Host' => 'localhost', 'Accept' => ['application/json']], $queryParam->buildHeaders($parameters));
     $body = $queryParam->buildFormDataString($parameters);
     $request = $this->messageFactory->createRequest('GET', $url, $headers, $body);
     $promise = $this->httpClient->sendAsyncRequest($request);
     if (self::FETCH_PROMISE === $fetch) {
         return $promise;
     }
     $response = $promise->wait();
     return $response;
 }
Beispiel #3
0
 /**
  * @param array  $parameters List of parameters
  * @param string $fetch      Fetch mode (object or response)
  *
  * @return \Psr\Http\Message\ResponseInterface|\Joli\Jane\OpenApi\Tests\Expected\Model\Schema[]
  */
 public function getTestList($parameters = [], $fetch = self::FETCH_OBJECT)
 {
     $queryParam = new QueryParam();
     $url = '/test-list';
     $url = $url . ('?' . $queryParam->buildQueryString($parameters));
     $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
     $body = $queryParam->buildFormDataString($parameters);
     $request = $this->messageFactory->createRequest('GET', $url, $headers, $body);
     $promise = $this->httpClient->sendAsyncRequest($request);
     if (self::FETCH_PROMISE === $fetch) {
         return $promise;
     }
     $response = $promise->wait();
     if (self::FETCH_OBJECT == $fetch) {
         if ('200' == $response->getStatusCode()) {
             return $this->serializer->deserialize((string) $response->getBody(), 'Joli\\Jane\\OpenApi\\Tests\\Expected\\Model\\Schema[]', 'json');
         }
     }
     return $response;
 }