Abstract Class SimpleExpectation

Description

Assertion that can display failure information.

Also includes various helper methods.

  • abstract:

Located in /expectation.php (line 23)


	
			
Direct descendents
Class Description
 class CssSelectorExpectation CssSelectorExpectation
 class AnythingExpectation A wildcard expectation always matches.
 class FailedExpectation An expectation that never matches.
 class TrueExpectation An expectation that passes on boolean true.
 class FalseExpectation An expectation that passes on boolean false.
 class EqualExpectation Test for equality.
 class WithinMarginExpectation Test for being within a range.
 class PatternExpectation Test for a pattern using Perl regex rules.
 class IsAExpectation Tests either type or class name if it's an object.
 class MethodExistsExpectation Tests for existance of a method in an object
 class ExceptionExpectation Tests exceptions either by type or the exact exception. This could be improved to accept a pattern expectation to test the error message, but that will have to come later.
 class FieldExpectation Test for an HTML widget value match.
 class HttpHeaderExpectation Test for a specific HTTP header within a header block.
 class TextExpectation Test for a text substring.
 class ParametersExpectation Parameter comparison assertion.
 class CallCountExpectation Confirms that the number of calls on a method is as expected.
 class MinimumCallCountExpectation Confirms that the number of calls on a method is as expected.
 class MaximumCallCountExpectation Confirms that the number of calls on a method is as expected.
Variable Summary
 mixed $dumper
Method Summary
 static boolean isExpectation (mixed $expectation)
 SimpleExpectation __construct ([string $message = '%s'])
 string overlayMessage (mixed $compare, SimpleDumper $dumper)
 boolean test (mixed $compare)
 string testMessage (mixed $compare)
Variables
mixed $dumper = false (line 24)
  • access: protected
Methods
static isExpectation (line 93)

Test to see if a value is an expectation object.

A useful utility method.

  • return: True if descended from this class.
  • access: public
boolean isExpectation (mixed $expectation)
  • mixed $expectation: Hopefully an Expectation class.
Constructor __construct (line 32)

Creates a dumper for displaying values and sets the test message.

SimpleExpectation __construct ([string $message = '%s'])
  • string $message: Customised message on failure.

Redefined in descendants as:
getDumper (line 76)

Accessor for the dumper.

  • return: Current value dumper.
  • access: protected
SimpleDumper getDumper ()
overlayMessage (line 66)

Overlays the generated message onto the stored user message. An additional message can be interjected.

  • return: Description of success or failure.
  • access: public
string overlayMessage (mixed $compare, SimpleDumper $dumper)
  • mixed $compare: Comparison value.
  • SimpleDumper $dumper: For formatting the results.
test (line 43)

Tests the expectation. True if correct.

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

Redefined in descendants as:
testMessage (line 54)

Returns a human readable test message.

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

Redefined in descendants as:

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