Class PatternExpectation

Description

Test for a pattern using Perl regex rules.

Located in /expectation.php (line 594)

SimpleExpectation
   |
   --PatternExpectation
Direct descendents
Class Description
 class WantedPatternExpectation
 class NoPatternExpectation Fail if a pattern is detected within the comparison.
Variable Summary
 mixed $_pattern
Method Summary
 PatternExpectation PatternExpectation (string $pattern, [string $message = '%s'])
 boolean test (string $compare)
 string testMessage (mixed $compare)
 void _describePatternMatch (string $pattern, string $subject)
 string _getPattern ()
Variables
mixed $_pattern (line 595)

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$_dumper
SimpleExpectation::$_message
Methods
Constructor PatternExpectation (line 603)

Sets the value to compare against.

  • access: public
PatternExpectation PatternExpectation (string $pattern, [string $message = '%s'])
  • string $pattern: Pattern to search for.
  • string $message: Customised message on failure.
test (line 624)

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

  • return: True if correct.
  • access: public
boolean test (string $compare)
  • string $compare: Comparison value.

Redefinition of:
SimpleExpectation::test()
Tests the expectation. True if correct.

Redefined in descendants as:
testMessage (line 635)

Returns a human readable test message.

  • return: Description of success or failure.
  • access: public
string testMessage (mixed $compare)
  • mixed $compare: Comparison value.

Redefinition of:
SimpleExpectation::testMessage()
Returns a human readable test message.

Redefined in descendants as:
_describePatternMatch (line 653)

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

  • access: protected
void _describePatternMatch (string $pattern, string $subject)
  • string $pattern: Regex to match against.
  • string $subject: Subject to search.
_getPattern (line 613)

Accessor for the pattern.

  • return: Perl regex as string.
  • access: protected
string _getPattern ()

Inherited Methods

Inherited From SimpleExpectation

 SimpleExpectation::SimpleExpectation()
 SimpleExpectation::isExpectation()
 SimpleExpectation::overlayMessage()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()
 SimpleExpectation::_getDumper()

Documentation generated on Sun, 04 May 2008 09:21:36 -0500 by phpDocumentor 1.3.0