PHP Class Horde_Http_Request_Mock, horde

Author: Chuck Hagenbuch ([email protected])
Author: Gunnar Wrobel ([email protected])
Inheritance: extends Horde_Http_Request_Base
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_responses array Mock responses to return.

Méthodes publiques

Méthode Description
addResponse ( string | resourse $body, string $code = 200, string $uri = '', array $headers = [] ) : Horde_Http_Response_Mock Adds a response to the stack of responses.
addResponses ( array $responses ) : null Set the HTTP response(s) to be returned by this adapter as an array of strings.
send ( ) : Horde_Http_Response_Mock | null Send this HTTP request
setResponse ( Horde_Http_Response_Base $response ) Set the HTTP response(s) to be returned by this adapter. This overwrites any responses set before.

Method Details

addResponse() public méthode

Adds a response to the stack of responses.
public addResponse ( string | resourse $body, string $code = 200, string $uri = '', array $headers = [] ) : Horde_Http_Response_Mock
$body string | resourse The response body content.
$code string The response code.
$uri string The request uri.
$headers array Response headers. This can be one string representing the whole header or an array of strings with one string per header line.
Résultat Horde_Http_Response_Mock The response.

addResponses() public méthode

Set the HTTP response(s) to be returned by this adapter as an array of strings.
public addResponses ( array $responses ) : null
$responses array The responses to be added to the stack.
Résultat null

send() public méthode

Send this HTTP request
public send ( ) : Horde_Http_Response_Mock | null
Résultat Horde_Http_Response_Mock | null A response object or NULL in case no responses has been set.

setResponse() public méthode

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

Property Details

$_responses protected_oe property

Mock responses to return.
protected array $_responses
Résultat array