本文整理汇总了PHP中SimpleExpectation::test方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleExpectation::test方法的具体用法?PHP SimpleExpectation::test怎么用?PHP SimpleExpectation::test使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleExpectation
的用法示例。
在下文中一共展示了SimpleExpectation::test方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assert
/**
* 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())));
}
}
示例2: assertExpectation
/**
* 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)));
}
示例3: assert
/**
* 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)));
}
示例4: assertExpectation
/**
* 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.
* @access public
*/
function assertExpectation(&$expectation, $test_value, $message)
{
$this->assertTrue($expectation->test($test_value), sprintf($message, $expectation->testMessage($test_value)));
}
示例5: checkExpectation
/**
* Runs an expectation directly, taking a possibly expected fail
* into account by turning the tables then.
* @param SimpleExpectation $expectation Expectation subclass.
* @param mixed $compare Value to compare.
* @return boolean True on pass / expected fail, false on fail / unexpected pass.
* @access public
*/
function checkExpectation($expectation, $compare)
{
$rv = $expectation->test($compare);
return $rv;
}
示例6: assert
/**
* 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())));
}
}