PHP Класс SimpleErrorQueue, simpletest

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.