fail() protected method

Throws an exception for the given compared value and test description
protected fail ( mixed $other, string $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = null )
$other mixed Evaluated value or object.
$description string Additional information about the test
$comparisonFailure SebastianBergmann\Comparator\ComparisonFailure
コード例 #1
0
ファイル: Not.php プロジェクト: AroundPBT/PHPBoost
 /**
  * @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);
     }
 }
コード例 #2
0
 /**
  *
  *
  * @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);
     }
 }
コード例 #3
0
ファイル: Attribute.php プロジェクト: 453111208/bbc
 /**
  * @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);
 }
コード例 #4
0
ファイル: And.php プロジェクト: KnpLabs/phpunit-easyinstall
 /**
  * @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);
 }
コード例 #5
0
ファイル: Assert.php プロジェクト: xiplias/pails
 /**
  *
  *
  * @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);
     }
 }
コード例 #6
0
ファイル: ArrayHas.php プロジェクト: rickb838/scalr
 /**
  * {@inheritdoc}
  * @see PHPUnit_Framework_Constraint::fail()
  */
 public function fail($other, $description, \PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL)
 {
     parent::fail($other[$this->arrayKey], $description, $comparisonFailure);
 }
コード例 #7
0
ファイル: Config.php プロジェクト: NatashaOlut/Mage_Test
 /**
  * @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);
 }
コード例 #8
0
 /**
  * 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);
 }