getInnerResponse() public method

Returns the inner response object returned by the underlying client.
public getInnerResponse ( ) : mixed
return mixed
Ejemplo n.º 1
0
 public function assertHttpStatus($expected, HttpBindingResultInterface $result, $message = null)
 {
     $response = $result->getInnerResponse();
     $status = $response->getStatusCode();
     $message = $message ?: $response->getBody();
     return $this->assertSame($expected, $status, $message);
 }
Ejemplo n.º 2
0
 protected function getResultCount(HttpBindingResultInterface $result)
 {
     $response = json_decode($result->getInnerResponse()->getBody());
     if (array_key_exists(0, $response->result) && property_exists($response->result[0], 'count')) {
         return $response->result[0]->count;
     }
     if (array_key_exists(0, $response->result) && property_exists($response->result[0], 'size')) {
         return $response->result[0]->size;
     }
     if (property_exists($response, 'result')) {
         return count($response->result);
     }
     throw new \Exception('Unable to retrieve a count from the given response.');
 }