You are here

protected function PHPUnit_Framework_Constraint::fail in Zircon Profile 8

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

SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure:

Throws

PHPUnit_Framework_ExpectationFailedException

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

... See full list

File

vendor/phpunit/phpunit/src/Framework/Constraint.php, line 93

Class

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

Code

protected function fail($other, $description, SebastianBergmann\Comparator\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);
}