PHP Class FieldExpectation, simpletest

Inheritance: extends SimpleExpectation
Mostrar archivo Open project: simpletest/simpletest Class Usage Examples

Public Methods

Method Description
__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.

Protected Methods

Method Description
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.

Method Details

__construct() public method

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() protected method

Tests for valid field comparisons with a single option.
protected isSingle ( mixed $value ) : boolean
$value mixed Value to type check.
return boolean True if integer, string or float.

test() public method

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.
return boolean True if correct.

testMessage() public method

Returns a human readable test message.
public testMessage ( mixed $compare ) : string
$compare mixed Comparison value.
return string Description of success or failure.

testMultiple() protected method

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

testSingle() protected method

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