TYPO3
7.6
|
Public Member Functions | |
sendRequest (HTTP_Request2 $request) | |
addResponse ($response, $url=null) | |
Public Member Functions inherited from HTTP_Request2_Adapter | |
sendRequest (HTTP_Request2 $request) | |
Static Public Member Functions | |
static | createResponseFromString ($str) |
static | createResponseFromFile ($fp) |
Protected Attributes | |
$responses = array() | |
Protected Attributes inherited from HTTP_Request2_Adapter | |
$request | |
$requestBody | |
$contentLength | |
Additional Inherited Members | |
Protected Member Functions inherited from HTTP_Request2_Adapter | |
calculateRequestLength (&$headers) | |
Static Protected Attributes inherited from HTTP_Request2_Adapter | |
static | $bodyDisallowed = array('TRACE') |
static | $bodyRequired = array('POST', 'PUT') |
addResponse | ( | $response, | |
$url = null |
|||
) |
Adds response to the queue
mixed | $response | either a string, a pointer to an open file, an instance of HTTP_Request2_Response or Exception |
string | $url | A request URL this response should be valid for (see http://pear.php.net/bugs/bug.php?id=19276) |
HTTP_Request2_Exception |
|
static |
Creates a new HTTP_Request2_Response object from a file
resource | $fp | file pointer returned by fopen() |
HTTP_Request2_Exception |
Definition at line 152 of file Mock.php.
References $response.
|
static |
Creates a new HTTP_Request2_Response object from a string
string | $str | string containing HTTP response message |
HTTP_Request2_Exception |
Definition at line 129 of file Mock.php.
References $response.
sendRequest | ( | HTTP_Request2 | $request | ) |
Returns the next response from the queue built by addResponse()
Only responses without explicit URLs or with URLs equal to request URL will be considered. If matching response is not found or the queue is empty then default empty response with status 400 will be returned, if an Exception object was added to the queue it will be thrown.
HTTP_Request2 | $request | HTTP request message |
Exception |
Definition at line 71 of file Mock.php.
References $response, elseif, and HTTP_Request2\getUrl().