Class HttpHeaderExpectation

Description

Test for a specific HTTP header within a header block.

Located in /libraries/pear/simpletest/web_tester.php (line 131)

SimpleExpectation
   |
   --HttpHeaderExpectation
Direct descendents
Class Description
 class HttpUnwantedHeaderExpectation Test for a specific HTTP header within a header block that should not be found.
 class HttpHeaderPatternExpectation Test for a specific HTTP header within a header block.
Variable Summary
Method Summary
 HttpHeaderExpectation HttpHeaderExpectation (string $header, [string $value = false])
 boolean test (mixed $compare)
 string testMessage (mixed $compare)
 string _findHeader (mixed $compare)
 mixed _getExpectation ()
 void _normaliseHeader (string $header, string 1)
 boolean _testHeaderLine (string $line)
 boolean _testHeaderValue (string $value, mixed $expected)
Variables
mixed $_expected_header (line 132)

Redefined in descendants as:
mixed $_expected_value (line 133)

Redefined in descendants as:

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$_dumper
SimpleExpectation::$_message
Methods
Constructor HttpHeaderExpectation (line 141)

Sets the field and value to compare against.

HttpHeaderExpectation HttpHeaderExpectation (string $header, [string $value = false])
  • string $header: Case insenstive trimmed header name.
  • string $value: Optional value to compare. If not given then any value will match.
test (line 173)

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

  • return: True if header present.
  • access: public
boolean test (mixed $compare)
  • mixed $compare: Raw header block to search.

Redefinition of:
SimpleExpectation::test()
Tests the expectation. True if correct.

Redefined in descendants as:
testMessage (line 232)

Returns a human readable test message.

  • return: Description of success or failure.
  • access: public
string testMessage (mixed $compare)
  • mixed $compare: Raw header block to search.

Redefinition of:
SimpleExpectation::testMessage()
Returns a human readable test message.

Redefined in descendants as:
_findHeader (line 184)

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

  • return: Matching header line.
  • access: protected
string _findHeader (mixed $compare)
  • mixed $compare: Raw header block to search.
_getExpectation (line 151)

Accessor for subclases.

  • return: Expectation set in constructor.
  • access: protected
mixed _getExpectation ()
_normaliseHeader (line 162)

Removes whitespace at ends and case variations.

  • access: private
void _normaliseHeader (string $header, string 1)
  • string $header: Name of header.
  • string 1: Trimmed and lowecased header name.
_testHeaderLine (line 200)

Compares a single header line against the expectation.

  • return: True if matched.
  • access: private
boolean _testHeaderLine (string $line)
  • string $line: A single line to compare.
_testHeaderValue (line 218)

Tests the value part of the header.

  • return: True if matched.
  • access: protected
boolean _testHeaderValue (string $value, mixed $expected)
  • string $value: Value to test.
  • mixed $expected: Value to test against.

Redefined in descendants as:

Inherited Methods

Inherited From SimpleExpectation

 SimpleExpectation::SimpleExpectation()
 SimpleExpectation::overlayMessage()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()
 SimpleExpectation::_getDumper()

Documentation generated on Fri, 11 Feb 2005 18:14:36 +0000 by phpDocumentor 1.3.0RC3