From e310f21a220f8e52d5ef86d2474bd2fbeeb82e25 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 3 Jun 2015 15:00:36 +0200 Subject: [PATCH] fix ezcTestConstraintSimilarImage for recent phpunit --- src/constraint/image.php | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/constraint/image.php b/src/constraint/image.php index be037c5..7c837ab 100644 --- a/src/constraint/image.php +++ b/src/constraint/image.php @@ -154,36 +154,22 @@ public function evaluate( $other, $description = '', $returnResult = false ) * @param boolean $not Flag to indicate negation. * @throws PHPUnit_Framework_ExpectationFailedException */ - public function fail( $other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL ) + public function fail( $other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = NULL ) { $failureDescription = sprintf( 'Failed asserting that image "%s" is similar to image "%s".', - $other, $this->filename ); - if ($not) { - $failureDescription = self::negate($failureDescription); - } - if (!empty($description)) { $failureDescription = $description . "\n" . $failureDescription; } - if (!$not) { - throw new PHPUnit_Framework_ExpectationFailedException( - $failureDescription, - PHPUnit_Framework_ComparisonFailure::diffEqual( - $this->delta, - $this->difference - ) - ); - } else { - throw new PHPUnit_Framework_ExpectationFailedException( - $failureDescription - ); - } + throw new PHPUnit_Framework_ExpectationFailedException( + $failureDescription, + $comparisonFailure + ); } /**