You are here

protected function PHPUnit_Framework_Constraint_Exception::failureDescription in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php \PHPUnit_Framework_Constraint_Exception::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.

Parameters

mixed $other Evaluated value or object.:

Return value

string

Overrides PHPUnit_Framework_Constraint::failureDescription

File

vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php, line 51

Class

PHPUnit_Framework_Constraint_Exception
@since Class available since Release 3.6.6

Code

protected function failureDescription($other) {
  if ($other !== null) {
    $message = '';
    if ($other instanceof Exception) {
      $message = '. Message was: "' . $other
        ->getMessage() . '" at' . "\n" . $other
        ->getTraceAsString();
    }
    return sprintf('exception of type "%s" matches expected exception "%s"%s', get_class($other), $this->className, $message);
  }
  return sprintf('exception of type "%s" is thrown', $this->className);
}