Class WithinMarginExpectation

Description

Test for being within a range.

Located in /expectation.php (line 328)

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

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$_dumper
SimpleExpectation::$_message
Methods
Constructor WithinMarginExpectation (line 340)

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

  • access: public
WithinMarginExpectation WithinMarginExpectation (mixed $value, mixed $margin, [string $message = '%s'])
  • mixed $value: Test value to match.
  • mixed $margin: Fuzziness of match.
  • string $message: Customised message on failure.
test (line 353)

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 364)

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::SimpleExpectation()
 SimpleExpectation::isExpectation()
 SimpleExpectation::overlayMessage()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()
 SimpleExpectation::_getDumper()

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