Class WantedPatternExpectation

Description

Test for a pattern using Perl regex rules.

Located in /libraries/pear/simpletest/expectation.php (line 266)

SimpleExpectation
   |
   --WantedPatternExpectation
Direct descendents
Class Description
 class UnwantedPatternExpectation Fail if a pattern is detected within the comparison.
Variable Summary
 mixed $_pattern
Method Summary
 WantedPatternExpectation WantedPatternExpectation (string $pattern)
 boolean test (string $compare)
 string testMessage (mixed $compare)
 void _decribePatternMatch (string $pattern, string $subject)
 string _getPattern ()
Variables
mixed $_pattern (line 267)

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$_dumper
Methods
Constructor WantedPatternExpectation (line 274)

Sets the value to compare against.

  • access: public
WantedPatternExpectation WantedPatternExpectation (string $pattern)
  • string $pattern: Pattern to search for.
test (line 295)

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

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:
_decribePatternMatch (line 324)

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

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

Accessor for the pattern.

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

Inherited Methods

Inherited From SimpleExpectation

 SimpleExpectation::SimpleExpectation()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()
 SimpleExpectation::_getDumper()

Documentation generated on Fri, 3 Dec 2004 12:26:39 +0000 by phpDocumentor 1.3.0RC3