PHP Класс Horde_Http_Request_Mock, horde

Автор: Chuck Hagenbuch ([email protected])
Автор: Gunnar Wrobel ([email protected])
Наследование: extends Horde_Http_Request_Base
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_responses array Mock responses to return.

Открытые методы

Метод Описание
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.

Описание методов

addResponse() публичный метод

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.
Результат Horde_Http_Response_Mock The response.

addResponses() публичный метод

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.
Результат null

send() публичный метод

Send this HTTP request
public send ( ) : Horde_Http_Response_Mock | null
Результат Horde_Http_Response_Mock | null A response object or NULL in case no responses has been set.

setResponse() публичный метод

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

Описание свойств

$_responses защищенное свойство

Mock responses to return.
protected array $_responses
Результат array