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 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 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 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 ReferenceExpectation Test for reference.
 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 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
 mixed $_message
Method Summary
 static boolean isExpectation (mixed $expectation)
 SimpleExpectation SimpleExpectation ([string $message = '%s'])
 string overlayMessage (mixed $compare, SimpleDumper $dumper)
 boolean test (mixed $compare)
 string testMessage (mixed $compare)
Variables
mixed $_dumper = false (line 24)
mixed $_message (line 25)
Methods
static isExpectation (line 94)

Test to see if a value is an expectation object.

A useful utility method.

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

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

SimpleExpectation SimpleExpectation ([string $message = '%s'])
  • string $message: Customised message on failure.
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:
_getDumper (line 76)

Accessor for the dumper.

  • return: Current value dumper.
  • access: protected
SimpleDumper &_getDumper ()

Documentation generated on Sun, 04 May 2008 09:21:36 -0500 by phpDocumentor 1.3.0