protected function 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

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php, line 93

Class

PHPUnit_Framework_Constraint_Exception
@package PHPUnit @subpackage Framework_Constraint @author Sebastian Bergmann <sebastian@phpunit.de> @copyright 2001-2013 Sebastian Bergmann <sebastian@phpunit.de> @license http://www.opensource.org/licenses/BSD-3-Clause The BSD…

Code

protected function failureDescription($other) {
  if ($other !== NULL) {
    $message = '';
    if ($other instanceof Exception && $other
      ->getMessage()) {
      $message = '. Message was: "' . $other
        ->getMessage() . '"';
    }
    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);
}