/** * @param mixed $other The value passed to evaluate() which failed the * constraint check. * @param string $description A string with extra description of what was * going on while the evaluation failed. * @param boolean $not Flag to indicate negation. * @throws PHPUnit_Framework_ExpectationFailedException */ public function fail($other, $description, $not = FALSE) { if (count($this->constraint) == 1 || $this->constraint instanceof PHPUnit_Framework_Constraint_Attribute) { $this->constraint->fail($other, $description, TRUE); } else { parent::fail($other, $description, !$not); } }
/** * * * @param mixed $value * @param PHPUnit_Framework_Constraint $constraint * @param string $message * @access public * @static * @since Method available since Release 3.0.0 */ public static function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '') { if (!$constraint->evaluate($value)) { $constraint->fail($value, $message); } }
/** * @param mixed $other The value passed to evaluate() which failed the * constraint check. * @param string $description A string with extra description of what was * going on while the evaluation failed. * @param boolean $not Flag to indicate negation. * @throws PHPUnit_Framework_ExpectationFailedException */ public function fail($other, $description, $not = FALSE) { parent::fail(PHPUnit_Framework_Assert::readAttribute($other, $this->attributeName), $description, $not); }
/** * @param mixed $other The value passed to evaluate() which failed the * constraint check. * @param string $description A string with extra description of what was * going on while the evaluation failed. * @param boolean $not Flag to indicate negation. * @throws PHPUnit_Framework_ExpectationFailedException */ public function fail($other, $description, $not = FALSE) { $this->lastConstraint->fail($other, $description, $not); }
/** * * * @param mixed $value * @param PHPUnit_Framework_Constraint $constraint * @param string $message * @since Method available since Release 3.0.0 */ public static function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '') { $stack = debug_backtrace(); for ($i = 1; $i <= 2; $i++) { if (isset($stack[$i]['object']) && $stack[$i]['object'] instanceof PHPUnit_Framework_TestCase) { $test = $stack[$i]['object']; } } if (isset($test)) { $test->incrementAssertionCounter(); } if (!$constraint->evaluate($value)) { $constraint->fail($value, $message); } }
/** * {@inheritdoc} * @see PHPUnit_Framework_Constraint::fail() */ public function fail($other, $description, \PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) { parent::fail($other[$this->arrayKey], $description, $comparisonFailure); }
/** * @todo * * @param mixed $other * @param string $description * @param boolean $not */ public function fail($other, $description, $not) { $nodeValue = $this->getNodeValue($other); return $this->constraint->fail($nodeValue, $description, $not); }
/** * Failure generator * * @param mixed $other * @param string $description * @param \SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure */ public function fail($other, $description, \SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = NULL) { $nodeValue = $this->getNodeValue($other); return $this->constraint->fail($nodeValue, $description, $comparisonFailure); }