Zend Framework  1.12
Public Member Functions | Protected Attributes | List of all members
Zend_Http_Client_Adapter_Test Class Reference

Public Member Functions

 __construct ()
 Adapter constructor, currently empty.
 
 setNextRequestWillFail ($flag)
 Set the nextRequestWillFail flag.
 
 setConfig ($config=array())
 Set the configuration array for the adapter.
 
 connect ($host, $port=80, $secure=false)
 Connect to the remote server.
 
 write ($method, $uri, $http_ver= '1.1', $headers=array(), $body= '')
 Send request to the remote server.
 
 read ()
 Return the response set in $this->setResponse()
 
 close ()
 Close the connection (dummy)
 
 setResponse ($response)
 Set the HTTP response(s) to be returned by this adapter.
 
 addResponse ($response)
 Add another response to the response buffer.
 
 setResponseIndex ($index)
 Sets the position of the response buffer.
 
 getConfig ()
 Retrieve the array of all configuration options.
 

Protected Attributes

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

Constructor & Destructor Documentation

__construct ( )

Adapter constructor, currently empty.

Config is set using setConfig()

Member Function Documentation

addResponse (   $response)

Add another response to the response buffer.

Parameters
stringZend_Http_Response|$response
close ( )

Close the connection (dummy)

Implements Zend_Http_Client_Adapter_Interface.

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.

getConfig ( )

Retrieve the array of all configuration options.

Returns
array
read ( )

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

Returns
string

Implements Zend_Http_Client_Adapter_Interface.

setConfig (   $config = array())

Set the configuration array for the adapter.

Parameters
Zend_Config  |  array$config

Implements Zend_Http_Client_Adapter_Interface.

setNextRequestWillFail (   $flag)

Set the nextRequestWillFail flag.

Parameters
boolean$flag
Returns
Zend_Http_Client_Adapter_Test
setResponse (   $response)

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

Parameters
Zend_Http_Response | array | string$response
setResponseIndex (   $index)

Sets the position of the response buffer.

Selects which response will be returned on the next call to read().

Parameters
integer$index
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.

Member Data Documentation

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