Properties

$uri

$uri : string|\Horde_Url

Default URI if not specified for individual requests.

Type

string|\Horde_Url

$headers

$headers : array

Hash with additional request headers.

Type

array

$method

$method : string

Default request method if not specified for individual requests.

Type

string

$data

$data : array|string

POST data fields or POST/PUT data body.

Type

array|string

$username

$username : string

Authentication user name.

Type

string

$password

$password : string

Authentication password.

Type

string

$authenticationScheme

$authenticationScheme : string

Authentication method, one of the HordeHttp::AUTH* constants.

Type

string

$proxyServer

$proxyServer : string

Host name of a proxy server.

Type

string

$proxyPort

$proxyPort : integer

Port number of a proxy server.

Type

integer

$proxyType

$proxyType : integer

Proxy server type, one of the HordeHttp::PROXY* constants.

Type

integer

$proxyUsername

$proxyUsername : string

Proxy authentication user name.

Type

string

$proxyPassword

$proxyPassword : string

Proxy authentication password.

Type

string

$proxyAuthenticationScheme

$proxyAuthenticationScheme : string

Proxy authentication method, one of the HordeHttp::AUTH* constants.

Type

string

$redirects

$redirects : integer

Maximum number of redirects to follow.

Type

integer

$timeout

$timeout : integer

Timeout in seconds.

Type

integer

$userAgent

$userAgent : string

User-Agent: request header contents.

Type

string

$verifyPeer

$verifyPeer : boolean

Verify SSL peer certificates?

Type

boolean

$_headers

$_headers : array

Request headers

Type

array

$_options

$_options : array

Type

array

$_responses

$_responses : array

Mock responses to return.

Type

array

Methods

__construct()

__construct(  $options = array()) 

Constructor

Parameters

$options

setOptions()

setOptions(  $options = array()) 

Parameters

$options

getDefaultOptions()

getDefaultOptions() 

send()

send() : \Horde_Http_Response_Mock|NULL

Send this HTTP request

Returns

\Horde_Http_Response_Mock|NULL —

A response object or NULL in case no responses has been set.

__get()

__get(string  $name) : mixed

Get an adapter parameter

Parameters

string $name

The parameter to get.

Returns

mixed —

Parameter value.

__set()

__set(string  $name, mixed  $value) 

Set a request parameter

Parameters

string $name

The parameter to set.

mixed $value

Parameter value.

setHeaders()

setHeaders(mixed  $headers, string  $value = null) 

Set one or more headers

Parameters

mixed $headers

A hash of header + value pairs, or a single header name

string $value

A header value

getHeader()

getHeader(string  $header) : string

Get the current value of $header

Parameters

string $header

Header name to get

Returns

string —

$header's current value

setResponse()

setResponse(\Horde_Http_Response_Base  $response) 

Set the HTTP response(s) to be returned by this adapter. This overwrites any responses set before.

Parameters

\Horde_Http_Response_Base $response

addResponses()

addResponses(array  $responses) : NULL

Set the HTTP response(s) to be returned by this adapter as an array of strings.

Parameters

array $responses

The responses to be added to the stack.

Returns

NULL

addResponse()

addResponse(string|\resourse  $body, string  $code = 200, string  $uri = '', array  $headers = array()) : \Horde_Http_Response_Mock

Adds a response to the stack of responses.

Parameters

string|\resourse $body

The response body content.

string $code

The response code.

string $uri

The request uri.

array $headers

Response headers. This can be one string representing the whole header or an array of strings with one string per header line.

Returns

\Horde_Http_Response_Mock

The response.