Method | Description | |
---|---|---|
__construct ( string $header, mixed $value = false, string $message = '%s' ) | Sets the field and value to compare against. | |
test ( mixed $compare ) : boolean | Tests the expectation. | |
testMessage ( mixed $compare ) : string | Returns a human readable test message. |
Method | Description | |
---|---|---|
findHeader ( mixed $compare ) : string | Searches the incoming result. Will extract the matching line as text. | |
getExpectation ( ) : mixed | Accessor for aggregated object. | |
normaliseHeader ( string $header ) | Removes whitespace at ends and case variations. | |
testHeaderLine ( string $line ) : boolean | Compares a single header line against the expectation. | |
testHeaderValue ( string $value, mixed $expected ) : boolean | Tests the value part of the header. |
public __construct ( string $header, mixed $value = false, string $message = '%s' ) | ||
$header | string | Case insenstive trimmed header name. |
$value | mixed | Optional value to compare. If not given then any value will match. If an expectation object then that will be used instead. |
$message | string | Optiona message override. Can use %s as a placeholder for the original message. |
protected findHeader ( mixed $compare ) : string | ||
$compare | mixed | Raw header block to search. |
return | string | Matching header line. |
protected getExpectation ( ) : mixed | ||
return | mixed | Expectation set in constructor. |
protected normaliseHeader ( string $header ) | ||
$header | string | Name of header. |
protected testHeaderLine ( string $line ) : boolean | ||
$line | string | A single line to compare. |
return | boolean | True if matched. |
public testMessage ( mixed $compare ) : string | ||
$compare | mixed | Raw header block to search. |
return | string | Description of success or failure. |