test() public method

Tests the expectation. True if it matches the held value.
public test ( mixed $compare ) : boolean
$compare mixed Comparison value.
return boolean True if correct.
Example #1
0
 public function testWithinFloatingPointMargin()
 {
     $within = new WithinMarginExpectation(1.0, 0.2);
     $this->assertFalse($within->test(0.7));
     $this->assertTrue($within->test(0.8));
     $this->assertTrue($within->test(0.9));
     $this->assertTrue($within->test(1.1));
     $this->assertTrue($within->test(1.2));
     $this->assertFalse($within->test(1.3));
 }
 /**
  *    Tests the expectation. True if it matches the
  *    held value.
  *    @param mixed $compare        Comparison value.
  *    @return boolean              True if correct.
  *    @access public
  */
 function test($compare)
 {
     return !parent::test($compare);
 }