PHP Класс PatternExpectation, simpletest

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

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

Метод Описание
__construct ( string $pattern, string $message = '%s' ) Sets the value to compare against.
test ( string $compare ) : boolean Tests the expectation. True if the Perl regex matches the comparison value.
testMessage ( mixed $compare ) : string Returns a human readable test message.

Защищенные методы

Метод Описание
describePatternMatch ( string $pattern, string $subject ) Describes a pattern match including the string found and it's position.
getPattern ( ) : string Accessor for the pattern.

Описание методов

__construct() публичный Метод

Sets the value to compare against.
public __construct ( string $pattern, string $message = '%s' )
$pattern string Pattern to search for.
$message string Customised message on failure.

describePatternMatch() защищенный Метод

Describes a pattern match including the string found and it's position.
protected describePatternMatch ( string $pattern, string $subject )
$pattern string Regex to match against.
$subject string Subject to search.

getPattern() защищенный Метод

Accessor for the pattern.
protected getPattern ( ) : string
Результат string Perl regex as string.

test() публичный Метод

Tests the expectation. True if the Perl regex matches the comparison value.
public test ( string $compare ) : boolean
$compare string Comparison value.
Результат boolean True if correct.

testMessage() публичный Метод

Returns a human readable test message.
public testMessage ( mixed $compare ) : string
$compare mixed Comparison value.
Результат string Description of success or failure.