本文整理汇总了PHP中PHPUnit_Framework_Constraint::failureDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Constraint::failureDescription方法的具体用法?PHP PHPUnit_Framework_Constraint::failureDescription怎么用?PHP PHPUnit_Framework_Constraint::failureDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Constraint
的用法示例。
在下文中一共展示了PHPUnit_Framework_Constraint::failureDescription方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: failureDescription
/**
* Returns the description of the failure
*
* The beginning of failure messages is "Failed asserting that" in most
* cases. This method should return the second part of that sentence.
*
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)
{
switch (get_class($this->constraint)) {
case 'PHPUnit_Framework_Constraint_And':
case 'PHPUnit_Framework_Constraint_Not':
case 'PHPUnit_Framework_Constraint_Or':
return 'not( ' . $this->constraint->failureDescription($other) . ' )';
default:
return self::negate($this->constraint->failureDescription($other));
}
}
示例2: failureDescription
/**
* Returns the description of the failure
*
* The beginning of failure messages is "Failed asserting that" in most
* cases. This method should return the second part of that sentence.
*
* @param mixed $other Evaluated value or object.
* @return string
*/
protected function failureDescription($other)
{
if (is_object($this->value) && is_object($other)) {
return 'two variables reference the same object';
}
if (is_string($this->value) && is_string($other)) {
return 'two strings are identical';
}
return parent::failureDescription($other);
}
示例3: failureDescription
/**
* Adds compatibility to PHPUnit 3.6
*
* @param mixed $other
* @return string
*/
protected function failureDescription($other)
{
if (method_exists($this, 'customFailureDescription')) {
return $this->customFailureDescription($other);
}
return parent::failureDescription($other);
}
示例4: failureDescription
/**
* Returns the description of the failure
*
* The beginning of failure messages is "Failed asserting that" in most
* cases. This method should return the second part of that sentence.
*
* To provide additional failure information additionalFailureDescription
* can be used.
*
* @param mixed $other Evaluated value or object.
* @return string
*/
protected function failureDescription($other)
{
return $this->constraint->failureDescription($other);
}
示例5: failureDescription
/**
* Returns the description of the failure
*
* The beginning of failure messages is "Failed asserting that" in most
* cases. This method should return the second part of that sentence.
*
* To provide additional failure information additionalFailureDescription
* can be used.
*
* @param mixed $other Evaluated value or object.
* @return string
*/
protected function failureDescription($other)
{
$nodeValue = $this->getNodeValue($other);
return $this->constraint->failureDescription($nodeValue);
}