Class HttpHeaderExpectation

Description

Test for a specific HTTP header within a header block.

Located in /web_tester.php (line 134)

SimpleExpectation
   |
   --HttpHeaderExpectation
Direct descendents
Class Description
 class NoHttpHeaderExpectation Test for a specific HTTP header within a header block that should not be found.
Variable Summary
Method Summary
 HttpHeaderExpectation HttpHeaderExpectation (string $header, [mixed $value = false], [string $message = '%s'])
 boolean test (mixed $compare)
 string testMessage (mixed $compare)
 string _findHeader (mixed $compare)
 mixed _getExpectation ()
 boolean _testHeaderValue (string $value, mixed $expected)
Variables
mixed $_expected_header (line 135)

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

Redefined in descendants as:

Inherited Variables

Inherited from SimpleExpectation

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

Sets the field and value to compare against.

HttpHeaderExpectation HttpHeaderExpectation (string $header, [mixed $value = false], [string $message = '%s'])
  • string $header: Case insenstive trimmed header name.
  • mixed $value: Optional value to compare. If not given then any value will match. If an expectation object then that will be used instead.
  • string $message: Optiona message override. Can use %s as a placeholder for the original message.
test (line 181)

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 243)

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 192)

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 159)

Accessor for aggregated object.

  • return: Expectation set in constructor.
  • access: protected
mixed _getExpectation ()
_testHeaderValue (line 226)

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.

Inherited Methods

Inherited From SimpleExpectation

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

Documentation generated on Sun, 04 May 2008 09:22:28 -0500 by phpDocumentor 1.3.0