Moodle  2.2.1
http://www.collinsharper.com
PatternExpectation Class Reference
Inheritance diagram for PatternExpectation:
Collaboration diagram for PatternExpectation:

Public Member Functions

 PatternExpectation ($pattern, $message= '%s')
 _getPattern ()
 test ($compare)
 testMessage ($compare)
 _describePatternMatch ($pattern, $subject)

Data Fields

 $_pattern

Detailed Description

Definition at line 594 of file expectation.php.


Member Function Documentation

_describePatternMatch ( pattern,
subject 
)

Describes a pattern match including the string found and it's position.

Parameters:
string$patternRegex to match against.
string$subjectSubject to search. protected

Definition at line 653 of file expectation.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Accessor for the pattern.

Returns:
string Perl regex as string. protected

Definition at line 613 of file expectation.php.

Here is the caller graph for this function:

PatternExpectation ( pattern,
message = '%s' 
)

Sets the value to compare against.

Parameters:
string$patternPattern to search for.
string$messageCustomised message on failure. public

Definition at line 603 of file expectation.php.

Here is the call graph for this function:

Here is the caller graph for this function:

test ( compare)

Tests the expectation. True if the Perl regex matches the comparison value.

Parameters:
string$compareComparison value.
Returns:
boolean True if correct. public

Reimplemented from SimpleExpectation.

Reimplemented in NoPatternExpectation.

Definition at line 624 of file expectation.php.

Here is the call graph for this function:

Here is the caller graph for this function:

testMessage ( compare)

Returns a human readable test message.

Parameters:
mixed$compareComparison value.
Returns:
string Description of success or failure. public

Reimplemented from SimpleExpectation.

Reimplemented in NoPatternExpectation.

Definition at line 635 of file expectation.php.

Here is the call graph for this function:


Field Documentation

$_pattern

Definition at line 595 of file expectation.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations