Beispiel #1
0
 protected function useResponse(Request $request, Response $response, $unserializeResult = true)
 {
     $this->transport->expects($this->once())->method('receiveResponse')->will($this->returnValue($response));
     if ($unserializeResult && ($request->isExpectingResult() || $response->getType() === MessageTypes::ERROR)) {
         $contentType = $response->getHeaders()->get('content-type');
         $this->serializer->expects($this->once())->method($response->getType() === MessageTypes::ERROR ? 'unserializeError' : 'unserializeResult')->with($request->getMethodName(), $response->getResultBody(), $contentType)->will($this->returnValue($response->getResultBody()));
     }
 }