An additional message can be interjected.
public overlayMessage ( mixed $compare, SimpleDumper $dumper ) : string | ||
$compare | mixed | Comparison value. |
$dumper | SimpleDumper | For formatting the results. |
Результат | string | Description of success or failure. |
/** * 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()))); } }
/** * 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') { return $this->assertTrue($expectation->test($compare), sprintf($message, $expectation->overlayMessage($compare))); }
/** * Runs an expectation directly, for extending the * tests with new expectation classes. * @param SimpleExpectation $expectation Expectation subclass. * @param mixed $test_value Value to compare. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertExpectation(&$expectation, $test_value, $message = '%s') { return $this->assertTrue($expectation->test($test_value), sprintf($message, $expectation->overlayMessage($test_value))); }
/** * 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 bool True on pass */ public function assert($expectation, $compare, $message = '%s') { $message = $this->escapePercentageSignsExceptFirst($message); 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()))); } }