summaryrefslogtreecommitdiffstats
path: root/php-zetacomponents-unit-test-pr5.patch
blob: b3a211ff2671d010af8faee2ab5fce33acf4ec8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From e310f21a220f8e52d5ef86d2474bd2fbeeb82e25 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
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
+        );
     }
 
     /**