[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/core/ -> TestResponse.php (summary)

(no description)

File Size: 114 lines (3 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

TestResponse:: (7 methods):
  __construct()
  getContent()
  getHeaders()
  getHeader()
  getStatusCode()
  queryHTML()
  getData()


Class: TestResponse  - X-Ref

holds a copy of all produced outputs of a TestRequest

__construct($content, $headers, $data = array()   X-Ref
Constructor

param: $content string the response body
param: $headers array the headers sent in the response
param: array $data any optional data passed back to the test system

getContent()   X-Ref
Returns the response body

return: string

getHeaders()   X-Ref
Returns the headers set in the response

return: array

getHeader($name)   X-Ref
Return a single header

return: mixed   if exactly one header, the header (string); otherwise an array of headers, empty when no headers
param: $name   string, the name of the header without the ':', e.g. 'Content-Type', 'Pragma'

getStatusCode()   X-Ref
Access the http status code

in the test environment, only status codes explicitly set by dokuwiki are likely to be returned
this means succcessful status codes (e.g. 200 OK) will not be present, but error codes will be

return: int  http status code

queryHTML($selector)   X-Ref
Query the response for a JQuery compatible CSS selector

link: https://code.google.com/p/phpquery/wiki/Selectors
return: phpQueryObject
param: $selector string

getData($key)   X-Ref
Returns all collected data for the given key

return: array
param: string $key