[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/zend/Zend/Http/Client/Adapter/ -> Test.php (summary)

Zend Framework LICENSE

Copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
License: http://framework.zend.com/license/new-bsd New BSD License
Version: $Id$
File Size: 238 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Zend_Http_Client_Adapter_Test:: (10 methods):
  __construct()
  setNextRequestWillFail()
  setConfig()
  connect()
  write()
  read()
  close()
  setResponse()
  addResponse()
  setResponseIndex()


Class: Zend_Http_Client_Adapter_Test  - X-Ref

A testing-purposes adapter.

Should be used to test all components that rely on Zend_Http_Client,
without actually performing an HTTP request. You should instantiate this
object manually, and then set it as the client's adapter. Then, you can
set the expected response using the setResponse() method.

__construct()   X-Ref
Adapter constructor, currently empty. Config is set using setConfig()


setNextRequestWillFail($flag)   X-Ref
Set the nextRequestWillFail flag

param: boolean $flag
return: Zend_Http_Client_Adapter_Test

setConfig($config = array()   X-Ref
Set the configuration array for the adapter

param: Zend_Config | array $config

connect($host, $port = 80, $secure = false)   X-Ref
Connect to the remote server

param: string  $host
param: int     $port
param: boolean $secure
param: int     $timeout

write($method, $uri, $http_ver = '1.1', $headers = array()   X-Ref
Send request to the remote server

param: string        $method
param: Zend_Uri_Http $uri
param: string        $http_ver
param: array         $headers
param: string        $body
return: string Request as string

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

return: string

close()   X-Ref
Close the connection (dummy)


setResponse($response)   X-Ref
Set the HTTP response(s) to be returned by this adapter

param: Zend_Http_Response|array|string $response

addResponse($response)   X-Ref
Add another response to the response buffer.

param: string Zend_Http_Response|$response

setResponseIndex($index)   X-Ref
Sets the position of the response buffer.  Selects which
response will be returned on the next call to read().

param: integer $index



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1