Class PatternExpectation

Description

Test for a pattern using Perl regex rules.

Located in /expectation.php (line 616)

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

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$dumper
Methods
Constructor __construct (line 625)

Sets the value to compare against.

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

Redefinition of:
SimpleExpectation::__construct()
Creates a dumper for displaying values and sets the test message.

Redefined in descendants as:
describePatternMatch (line 675)

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 635)

Accessor for the pattern.

  • return: Perl regex as string.
  • access: protected
string getPattern ()
test (line 646)

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 657)

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:

Inherited Methods

Inherited From SimpleExpectation

 SimpleExpectation::__construct()
 SimpleExpectation::getDumper()
 SimpleExpectation::isExpectation()
 SimpleExpectation::overlayMessage()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()

Documentation generated on Sun, 31 Oct 2010 16:31:28 -0500 by phpDocumentor 1.4.3