PHP Class ReferenceExpectation, simpletest

Show file Open project: simpletest/simpletest Class Usage Examples

Public Methods

Method Description
__construct ( mixed &$value, string $message = '%s' ) Sets the reference value to compare against.
overlayMessage ( mixed $compare, SimpleDumper $dumper ) : string Overlays the generated message onto the stored user message.
test ( mixed &$compare ) : boolean Tests the expectation. True if it exactly references the held value.
testMessage ( mixed $compare ) : string Returns a human readable test message.

Protected Methods

Method Description
getDumper ( ) : SimpleDumper Accessor for the dumper.

Method Details

__construct() public method

Sets the reference value to compare against.
public __construct ( mixed &$value, string $message = '%s' )
$value mixed Test reference to match.
$message string Customised message on failure.

getDumper() protected method

Accessor for the dumper.
protected getDumper ( ) : SimpleDumper
return SimpleDumper Current value dumper.

overlayMessage() public method

An additional message can be interjected.
public overlayMessage ( mixed $compare, SimpleDumper $dumper ) : string
$compare mixed Comparison value.
$dumper SimpleDumper For formatting the results.
return string Description of success or failure.

test() public method

Tests the expectation. True if it exactly references the held value.
public test ( mixed &$compare ) : boolean
$compare mixed Comparison reference.
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.