PHP Класс FieldExpectation, simpletest

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

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

Метод Описание
__construct ( mixed $value, string $message = '%s' ) Sets the field value to compare against.
test ( mixed $compare ) : boolean Tests the expectation. True if it matches a string value or an array value in any order.
testMessage ( mixed $compare ) : string Returns a human readable test message.

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

Метод Описание
isSingle ( mixed $value ) : boolean Tests for valid field comparisons with a single option.
testMultiple ( mixed $compare ) List comparison for multivalue field.
testSingle ( mixed $compare ) String comparison for simple field with a single option.

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

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

Sets the field value to compare against.
public __construct ( mixed $value, string $message = '%s' )
$value mixed Test value to match. Can be an expectation for say pattern matching.
$message string Optional message override. Can use %s as a placeholder for theoriginal message.

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

Tests for valid field comparisons with a single option.
protected isSingle ( mixed $value ) : boolean
$value mixed Value to type check.
Результат boolean True if integer, string or float.

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

Tests the expectation. True if it matches a string value or an array value in any order.
public test ( mixed $compare ) : boolean
$compare mixed Comparison value. False for an unset field.
Результат 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.

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

List comparison for multivalue field.
protected testMultiple ( mixed $compare )
$compare mixed List in any order to test against.

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

String comparison for simple field with a single option.
protected testSingle ( mixed $compare )
$compare mixed String to test against.