File: 0001-fix-ezcTestConstraintSimilarImage-for-recent-phpunit.patch

package info (click to toggle)
php-zeta-unit-test 1.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 304 kB
  • ctags: 92
  • sloc: php: 396; makefile: 7
file content (55 lines) | stat: -rw-r--r-- 1,994 bytes parent folder | download
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: Remi Collet <fedora@famillecollet.com>
Date: Wed, 3 Jun 2015 15:00:36 +0200
Subject: fix ezcTestConstraintSimilarImage for recent phpunit

Origin: upstream, https://github.com/zetacomponents/UnitTest/commit/a80e4680f69210fa9502c025ded9f7a9b80e65a5
---
 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 @@ class ezcTestConstraintSimilarImage extends PHPUnit_Framework_Constraint
      * @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
+        );
     }
 
     /**