overlayMessage() public method

An additional message can be interjected.
public overlayMessage ( mixed $compare, SimpleDumper $dumper ) : string
$compare mixed Comparison value.
$dumper SimpleDumper For formatting the results.
return string Description of success or failure.
Esempio n. 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())));
     }
 }
Esempio n. 2
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')
 {
     return $this->assertTrue($expectation->test($compare), sprintf($message, $expectation->overlayMessage($compare)));
 }
Esempio n. 3
0
 /**
  *    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)));
 }
Esempio n. 4
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 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())));
     }
 }