本文整理汇总了PHP中PHPUnit_Framework_Constraint::fail方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Constraint::fail方法的具体用法?PHP PHPUnit_Framework_Constraint::fail怎么用?PHP PHPUnit_Framework_Constraint::fail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Constraint
的用法示例。
在下文中一共展示了PHPUnit_Framework_Constraint::fail方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fail
/**
* @param mixed $other The value passed to evaluate() which failed the
* constraint check.
* @param string $description A string with extra description of what was
* going on while the evaluation failed.
* @param boolean $not Flag to indicate negation.
* @throws PHPUnit_Framework_ExpectationFailedException
*/
public function fail($other, $description, $not = FALSE)
{
if (count($this->constraint) == 1 || $this->constraint instanceof PHPUnit_Framework_Constraint_Attribute) {
$this->constraint->fail($other, $description, TRUE);
} else {
parent::fail($other, $description, !$not);
}
}
示例2: assertThat
/**
*
*
* @param mixed $value
* @param PHPUnit_Framework_Constraint $constraint
* @param string $message
* @access public
* @static
* @since Method available since Release 3.0.0
*/
public static function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
{
if (!$constraint->evaluate($value)) {
$constraint->fail($value, $message);
}
}
示例3: fail
/**
* @param mixed $other The value passed to evaluate() which failed the
* constraint check.
* @param string $description A string with extra description of what was
* going on while the evaluation failed.
* @param boolean $not Flag to indicate negation.
* @throws PHPUnit_Framework_ExpectationFailedException
*/
public function fail($other, $description, $not = FALSE)
{
parent::fail(PHPUnit_Framework_Assert::readAttribute($other, $this->attributeName), $description, $not);
}
示例4: fail
/**
* @param mixed $other The value passed to evaluate() which failed the
* constraint check.
* @param string $description A string with extra description of what was
* going on while the evaluation failed.
* @param boolean $not Flag to indicate negation.
* @throws PHPUnit_Framework_ExpectationFailedException
*/
public function fail($other, $description, $not = FALSE)
{
$this->lastConstraint->fail($other, $description, $not);
}
示例5: assertThat
/**
*
*
* @param mixed $value
* @param PHPUnit_Framework_Constraint $constraint
* @param string $message
* @since Method available since Release 3.0.0
*/
public static function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
{
$stack = debug_backtrace();
for ($i = 1; $i <= 2; $i++) {
if (isset($stack[$i]['object']) && $stack[$i]['object'] instanceof PHPUnit_Framework_TestCase) {
$test = $stack[$i]['object'];
}
}
if (isset($test)) {
$test->incrementAssertionCounter();
}
if (!$constraint->evaluate($value)) {
$constraint->fail($value, $message);
}
}
示例6: fail
/**
* {@inheritdoc}
* @see PHPUnit_Framework_Constraint::fail()
*/
public function fail($other, $description, \PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL)
{
parent::fail($other[$this->arrayKey], $description, $comparisonFailure);
}
示例7: fail
/**
* @todo
*
* @param mixed $other
* @param string $description
* @param boolean $not
*/
public function fail($other, $description, $not)
{
$nodeValue = $this->getNodeValue($other);
return $this->constraint->fail($nodeValue, $description, $not);
}
示例8: fail
/**
* Failure generator
*
* @param mixed $other
* @param string $description
* @param \SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure
*/
public function fail($other, $description, \SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = NULL)
{
$nodeValue = $this->getNodeValue($other);
return $this->constraint->fail($nodeValue, $description, $comparisonFailure);
}