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

Public Member Functions

 HttpHeaderExpectation ($header, $value=false, $message= '%s')
 _getExpectation ()
 _normaliseHeader ($header)
 test ($compare)
 _findHeader ($compare)
 _testHeaderLine ($line)
 _testHeaderValue ($value, $expected)
 testMessage ($compare)

Data Fields

 $_expected_header
 $_expected_value

Detailed Description

Definition at line 134 of file web_tester.php.


Member Function Documentation

_findHeader ( compare)

Searches the incoming result. Will extract the matching line as text.

Parameters:
mixed$compareRaw header block to search.
Returns:
string Matching header line. protected

Definition at line 192 of file web_tester.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Accessor for aggregated object.

Returns:
mixed Expectation set in constructor. protected

Definition at line 159 of file web_tester.php.

Here is the caller graph for this function:

_normaliseHeader ( header)

Removes whitespace at ends and case variations.

Parameters:
string$headerName of header.
stringTrimmed and lowecased header name. private

Definition at line 170 of file web_tester.php.

Here is the caller graph for this function:

_testHeaderLine ( line)

Compares a single header line against the expectation.

Parameters:
string$lineA single line to compare.
Returns:
boolean True if matched. private

Definition at line 208 of file web_tester.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_testHeaderValue ( value,
expected 
)

Tests the value part of the header.

Parameters:
string$valueValue to test.
mixed$expectedValue to test against.
Returns:
boolean True if matched. protected

Definition at line 226 of file web_tester.php.

Here is the call graph for this function:

Here is the caller graph for this function:

HttpHeaderExpectation ( header,
value = false,
message = '%s' 
)

Sets the field and value to compare against.

Parameters:
string$headerCase insenstive trimmed header name.
mixed$valueOptional value to compare. If not given then any value will match. If an expectation object then that will be used instead.
string$messageOptiona message override. Can use s as a placeholder for the original message.

Definition at line 148 of file web_tester.php.

Here is the call graph for this function:

Here is the caller graph for this function:

test ( compare)

Tests the expectation. True if it matches a string value or an array value in any order.

Parameters:
mixed$compareRaw header block to search.
Returns:
boolean True if header present. public

Reimplemented from SimpleExpectation.

Reimplemented in NoHttpHeaderExpectation.

Definition at line 181 of file web_tester.php.

Here is the call graph for this function:

testMessage ( compare)

Returns a human readable test message.

Parameters:
mixed$compareRaw header block to search.
Returns:
string Description of success or failure. public

Reimplemented from SimpleExpectation.

Reimplemented in NoHttpHeaderExpectation.

Definition at line 243 of file web_tester.php.

Here is the call graph for this function:


Field Documentation

$_expected_header

Reimplemented in NoHttpHeaderExpectation.

Definition at line 135 of file web_tester.php.

$_expected_value

Reimplemented in NoHttpHeaderExpectation.

Definition at line 136 of file web_tester.php.


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