protected function PHPUnit_Framework_Constraint::fail

Throws an exception for the given compared value and test description

Parameters

mixed $other Evaluated value or object.:

string $description Additional information about the test:

PHPUnit_Framework_ComparisonFailure $comparisonFailure:

Throws

PHPUnit_Framework_ExpectationFailedException

8 calls to PHPUnit_Framework_Constraint::fail()
PHPUnit_Framework_Constraint::evaluate in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php
Evaluates the constraint for parameter $other
PHPUnit_Framework_Constraint_And::evaluate in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php
Evaluates the constraint for parameter $other
PHPUnit_Framework_Constraint_Composite::evaluate in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php
Evaluates the constraint for parameter $other
PHPUnit_Framework_Constraint_IsIdentical::evaluate in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php
Evaluates the constraint for parameter $other
PHPUnit_Framework_Constraint_Not::evaluate in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php
Evaluates the constraint for parameter $other

... See full list

File

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

Class

PHPUnit_Framework_Constraint
Abstract base class for constraints. which are placed upon any value.

Code

protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) {
  $failureDescription = sprintf('Failed asserting that %s.', $this
    ->failureDescription($other));
  $additionalFailureDescription = $this
    ->additionalFailureDescription($other);
  if ($additionalFailureDescription) {
    $failureDescription .= "\n" . $additionalFailureDescription;
  }
  if (!empty($description)) {
    $failureDescription = $description . "\n" . $failureDescription;
  }
  throw new PHPUnit_Framework_ExpectationFailedException($failureDescription, $comparisonFailure);
}