SimpleTest


SimpleTest\HttpHeaderExpectation
web_tester.php at line 131

Class HttpHeaderExpectation

SimpleExpectation
└─HttpHeaderExpectation

public class HttpHeaderExpectation
extends SimpleExpectation

Test for a specific HTTP header within a header block.

Subpackage:
WebTester

Constructor Summary

HttpHeaderExpectation(string header, string value)

Sets the field and value to compare against.

Method Summary
boolean

test(mixed compare)

Tests the expectation.

string

testMessage(mixed compare)

Returns a human readable test message.

Methods inherited from SimpleTest\SimpleExpectation
overlayMessage, test, testMessage

Constructor Detail

web_tester.php at line 141

HttpHeaderExpectation

public HttpHeaderExpectation(string header, string value)

Sets the field and value to compare against.

Parameters:
header - Case insenstive trimmed header name.
value - Optional value to compare. If not given then any value will match.

Method Detail

web_tester.php at line 173

test

public boolean test(mixed compare)

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

Parameters:
compare - Raw header block to search.
Returns:
True if header present.

web_tester.php at line 232

testMessage

public string testMessage(mixed compare)

Returns a human readable test message.

Parameters:
compare - Raw header block to search.
Returns:
Description of success or failure.

SimpleTest