Moodle  2.2.1
http://www.collinsharper.com
Zend_Http_Client_Adapter_Test Class Reference
Inheritance diagram for Zend_Http_Client_Adapter_Test:
Collaboration diagram for Zend_Http_Client_Adapter_Test:

Public Member Functions

 __construct ()
 setNextRequestWillFail ($flag)
 setConfig ($config=array())
 connect ($host, $port=80, $secure=false)
 write ($method, $uri, $http_ver= '1.1', $headers=array(), $body= '')
 read ()
 close ()
 setResponse ($response)
 addResponse ($response)
 setResponseIndex ($index)

Protected Attributes

 $config = array()
 $responses = array("HTTP/1.1 400 Bad Request\r\n\r\n")
 $responseIndex = 0
 $_nextRequestWillFail = false

Detailed Description

Definition at line 50 of file Test.php.


Constructor & Destructor Documentation

Adapter constructor, currently empty. Config is set using setConfig()

Definition at line 85 of file Test.php.


Member Function Documentation

addResponse ( response)

Add another response to the response buffer.

Parameters:
stringZend_Http_Response|$response

Definition at line 214 of file Test.php.

close ( )

Close the connection (dummy)

Implements Zend_Http_Client_Adapter_Interface.

Definition at line 191 of file Test.php.

connect ( host,
port = 80,
secure = false 
)

Connect to the remote server

Parameters:
string$host
int$port
boolean$secure
int$timeout
Exceptions:
Zend_Http_Client_Adapter_Exception

Implements Zend_Http_Client_Adapter_Interface.

Definition at line 133 of file Test.php.

read ( )

Return the response set in $this->setResponse()

Returns:
string

Implements Zend_Http_Client_Adapter_Interface.

Definition at line 179 of file Test.php.

setConfig ( config = array())

Set the configuration array for the adapter

Parameters:
Zend_Config| array $config

Implements Zend_Http_Client_Adapter_Interface.

Definition at line 106 of file Test.php.

Set the nextRequestWillFail flag

Parameters:
boolean$flag
Returns:
Zend_Http_Client_Adapter_Test

Definition at line 94 of file Test.php.

setResponse ( response)

Set the HTTP response(s) to be returned by this adapter

Parameters:
Zend_Http_Response | array | string$response

Definition at line 199 of file Test.php.

setResponseIndex ( index)

Sets the position of the response buffer. Selects which response will be returned on the next call to read().

Parameters:
integer$index

Definition at line 229 of file Test.php.

write ( method,
uri,
http_ver = '1.1',
headers = array(),
body = '' 
)

Send request to the remote server

Parameters:
string$method
Zend_Uri_Http$uri
string$http_ver
array$headers
string$body
Returns:
string Request as string

Implements Zend_Http_Client_Adapter_Interface.

Definition at line 152 of file Test.php.


Field Documentation

$_nextRequestWillFail = false [protected]

Definition at line 79 of file Test.php.

$config = array() [protected]

Definition at line 57 of file Test.php.

$responseIndex = 0 [protected]

Definition at line 72 of file Test.php.

$responses = array("HTTP/1.1 400 Bad Request\r\n\r\n") [protected]

Definition at line 65 of file Test.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations