Class WithinMarginExpectation

Description

Test for being within a range.

Located in /expectation.php (line 327)

SimpleExpectation
   |
   --WithinMarginExpectation
Direct descendents
Class Description
 class OutsideMarginExpectation Test for being outside of a range.
Method Summary
 WithinMarginExpectation __construct (mixed $value, mixed $margin, [string $message = '%s'])
 void outsideMessage (mixed $compare)
 boolean test (mixed $compare)
 string testMessage (mixed $compare)
 void withinMessage (mixed $compare)
Variables

Inherited Variables

Inherited from SimpleExpectation

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

Sets the value to compare against and the fuzziness of the match. Used for comparing floating point values.

  • access: public
WithinMarginExpectation __construct (mixed $value, mixed $margin, [string $message = '%s'])
  • mixed $value: Test value to match.
  • mixed $margin: Fuzziness of match.
  • 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:
outsideMessage (line 386)

Creates a the message for being within the range.

  • access: protected
void outsideMessage (mixed $compare)
  • mixed $compare: Value being tested.
test (line 352)

Tests the expectation. True if it matches the held value.

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

Redefinition of:
SimpleExpectation::test()
Tests the expectation. True if correct.

Redefined in descendants as:
testMessage (line 363)

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:
withinMessage (line 376)

Creates a the message for being within the range.

  • access: protected
void withinMessage (mixed $compare)
  • mixed $compare: Value being tested.

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:31:29 -0500 by phpDocumentor 1.4.3