PHP Class TextExpectation, simpletest

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

Public Methods

Method Description
__construct ( string $substring, string $message = '%s' ) Sets the value to compare against.
test ( string $compare ) : boolean Tests the expectation. True if the text contains the substring.
testMessage ( mixed $compare ) : string Returns a human readable test message.

Protected Methods

Method Description
describeTextMatch ( string $substring, string $subject ) Describes a pattern match including the string found and it's position.
getSubstring ( ) : string Accessor for the substring.

Method Details

__construct() public method

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

describeTextMatch() protected method

Describes a pattern match including the string found and it's position.
protected describeTextMatch ( string $substring, string $subject )
$substring string Text to search for.
$subject string Subject to search.

getSubstring() protected method

Accessor for the substring.
protected getSubstring ( ) : string
return string Text to match.

test() public method

Tests the expectation. True if the text contains the substring.
public test ( string $compare ) : boolean
$compare string Comparison value.
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.