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.
Variable Summary
 mixed $_substring
Method Summary
 TextExpectation TextExpectation (string $substring, [string $message = '%s'])
 boolean test (string $compare)
 string testMessage (mixed $compare)
 void _describeTextMatch (string $substring, string $subject)
 string _getSubstring ()
Variables
mixed $_substring (line 311)

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$_dumper
SimpleExpectation::$_message
Methods
Constructor TextExpectation (line 319)

Sets the value to compare against.

  • access: public
TextExpectation TextExpectation (string $substring, [string $message = '%s'])
  • string $substring: Text to search for.
  • string $message: Customised message on failure.
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:
_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 ()

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:22:28 -0500 by phpDocumentor 1.3.0