SimpleExpectation::test PHP Method

test() public method

Tests the expectation. True if correct.
public test ( mixed $compare ) : boolean
$compare mixed Comparison value.
return boolean True if correct.
    public function test($compare)
    {
    }

Usage Example

示例#1
0
 /**
  *    Runs an expectation directly, for extending the
  *    tests with new expectation classes.
  *    @param SimpleExpectation $expectation  Expectation subclass.
  *    @param mixed $compare               Value to compare.
  *    @param string $message                 Message to display.
  *    @return boolean                        True on pass
  *    @access public
  */
 function assert(&$expectation, $compare, $message = '%s') {
     if ($expectation->test($compare)) {
         return $this->pass(sprintf(
                 $message,
                 $expectation->overlayMessage($compare, $this->_reporter->getDumper())));
     } else {
         return $this->fail(sprintf(
                 $message,
                 $expectation->overlayMessage($compare, $this->_reporter->getDumper())));
     }
 }
All Usage Examples Of SimpleExpectation::test