Horde_Http_Request_Mock::setResponse PHP Method

setResponse() public method

Set the HTTP response(s) to be returned by this adapter. This overwrites any responses set before.
public setResponse ( Horde_Http_Response_Base $response )
$response Horde_Http_Response_Base
    public function setResponse(Horde_Http_Response_Base $response)
    {
        $this->_responses = array($response);
    }

Usage Example

Exemplo n.º 1
0
 private function _getClient($code = 200)
 {
     $response = new Horde_Http_Response_Mock('', fopen(__DIR__ . '/../../../fixtures/owa_freebusy.xml', 'r'));
     $response->code = $code;
     $request = new Horde_Http_Request_Mock();
     $request->setResponse($response);
     return new Horde_Http_Client(array('request' => $request));
 }
All Usage Examples Of Horde_Http_Request_Mock::setResponse