PHP 클래스 HttpHeaderExpectation, simpletest

상속: extends SimpleExpectation
파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
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.

메소드 상세

__construct() 공개 메소드

Sets the field and value to compare against.
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.

findHeader() 보호된 메소드

Searches the incoming result. Will extract the matching line as text.
protected findHeader ( mixed $compare ) : string
$compare mixed Raw header block to search.
리턴 string Matching header line.

getExpectation() 보호된 메소드

Accessor for aggregated object.
protected getExpectation ( ) : mixed
리턴 mixed Expectation set in constructor.

normaliseHeader() 보호된 메소드

Removes whitespace at ends and case variations.
protected normaliseHeader ( string $header )
$header string Name of header.

test() 공개 메소드

True if it matches a string value or an array value in any order.
public test ( mixed $compare ) : boolean
$compare mixed Raw header block to search.
리턴 boolean True if header present.

testHeaderLine() 보호된 메소드

Compares a single header line against the expectation.
protected testHeaderLine ( string $line ) : boolean
$line string A single line to compare.
리턴 boolean True if matched.

testHeaderValue() 보호된 메소드

Tests the value part of the header.
protected testHeaderValue ( string $value, mixed $expected ) : boolean
$value string Value to test.
$expected mixed Value to test against.
리턴 boolean True if matched.

testMessage() 공개 메소드

Returns a human readable test message.
public testMessage ( mixed $compare ) : string
$compare mixed Raw header block to search.
리턴 string Description of success or failure.