Class TextExpectation

Description

Test for a text substring.

Located in /web_tester.php (line 310)

SimpleExpectation
   |
   --TextExpectation
Direct descendents
Class Description
 class NoTextExpectation Fail if a substring is detected within the comparison text.
Method Summary
 TextExpectation __construct (string $substring, [string $message = '%s'])
 void describeTextMatch (string $substring, string $subject)
 string getSubstring ()
 boolean test (string $compare)
 string testMessage (mixed $compare)
Variables

Inherited Variables

Inherited from SimpleExpectation

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

Sets the value to compare against.

  • access: public
TextExpectation __construct (string $substring, [string $message = '%s'])
  • string $substring: Text 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:
describeTextMatch (line 369)

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

  • access: protected
void describeTextMatch (string $substring, string $subject)
  • string $substring: Text to search for.
  • string $subject: Subject to search.
getSubstring (line 329)

Accessor for the substring.

  • return: Text to match.
  • access: protected
string getSubstring ()
test (line 340)

Tests the expectation. True if the text contains the substring.

  • 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 351)

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:33:04 -0500 by phpDocumentor 1.4.3