PHP 클래스 SimpleErrorQueue, simpletest

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

공개 메소드들

메소드 설명
__construct ( ) Starts with an empty queue.
add ( integer $severity, string $content, string $filename, integer $line ) Adds an error to the front of the queue.
clear ( ) Discards the contents of the error queue.
expectError ( SimpleExpectation $expected, string $message ) Sets up an expectation of an error.
extract ( ) : mixed Pulls the earliest error from the queue.
getSeverityAsString ( $severity ) : String Converts an error code into it's string representation.
setTestCase ( SimpleTestCase $test ) Sets the currently running test case.
tally ( ) Any errors still in the queue are sent to the test case.

보호된 메소드들

메소드 설명
extractExpectation ( ) : SimpleExpectation Pulls the earliest expectation from the queue.
testLatestError ( integer $severity, string $content, string $filename, integer $line ) Tests the error against the most recent expected error.

메소드 상세

__construct() 공개 메소드

Starts with an empty queue.
public __construct ( )

add() 공개 메소드

Adds an error to the front of the queue.
public add ( integer $severity, string $content, string $filename, integer $line )
$severity integer PHP error code.
$content string Text of error.
$filename string File error occoured in.
$line integer Line number of error.

clear() 공개 메소드

Discards the contents of the error queue.
public clear ( )

expectError() 공개 메소드

If this is not fulfilled at the end of the test, a failure will occour. If the error does happen, then this will cancel it out and send a pass message.
public expectError ( SimpleExpectation $expected, string $message )
$expected SimpleExpectation Expected error match.
$message string Message to display.

extract() 공개 메소드

The list of error informations contains: - severity as the PHP error code, - the error message, - the file with the error, - the line number and - a list of PHP super global arrays.
public extract ( ) : mixed
리턴 mixed False if none, or a list of error information.

extractExpectation() 보호된 메소드

Pulls the earliest expectation from the queue.
protected extractExpectation ( ) : SimpleExpectation
리턴 SimpleExpectation False if none.

getSeverityAsString() 공개 정적인 메소드

Converts an error code into it's string representation.
public static getSeverityAsString ( $severity ) : String
$severity PHP integer error code.
리턴 String version of error code.

setTestCase() 공개 메소드

Sets the currently running test case.
public setTestCase ( SimpleTestCase $test )
$test SimpleTestCase Test case to send messages to.

tally() 공개 메소드

Any unfulfilled expectations trigger failures.
public tally ( )

testLatestError() 보호된 메소드

Tests the error against the most recent expected error.
protected testLatestError ( integer $severity, string $content, string $filename, integer $line )
$severity integer PHP error code.
$content string Text of error.
$filename string File error occoured in.
$line integer Line number of error.