summaryrefslogtreecommitdiffstats
path: root/phpunit7-php8.patch
blob: d2a286ec9a0c7cca9f896a543a8862acce5e6711 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
diff -up ./src/Framework/MockObject/Builder/Match.php.php8 ./src/Framework/MockObject/Builder/Match.php
--- ./src/Framework/MockObject/Builder/Match.php.php8	2020-01-08 09:45:45.000000000 +0100
+++ ./src/Framework/MockObject/Builder/Match.php	2021-03-24 14:30:25.218737051 +0100
@@ -12,7 +12,7 @@ namespace PHPUnit\Framework\MockObject\B
 /**
  * Builder interface for invocation order matches.
  */
-interface Match extends Stub
+interface Match_ extends Stub
 {
     /**
      * Defines the expectation which must occur before the current is valid.
diff -up ./src/Framework/MockObject/Builder/NamespaceMatch.php.php8 ./src/Framework/MockObject/Builder/NamespaceMatch.php
--- ./src/Framework/MockObject/Builder/NamespaceMatch.php.php8	2020-01-08 09:45:45.000000000 +0100
+++ ./src/Framework/MockObject/Builder/NamespaceMatch.php	2021-03-24 14:30:25.218737051 +0100
@@ -33,5 +33,5 @@ interface NamespaceMatch
      * @param string $id      The identification of the match builder
      * @param Match  $builder The builder which is being registered
      */
-    public function registerId($id, Match $builder);
+    public function registerId($id, Match_ $builder);
 }
diff -up ./src/Framework/MockObject/Builder/ParametersMatch.php.php8 ./src/Framework/MockObject/Builder/ParametersMatch.php
--- ./src/Framework/MockObject/Builder/ParametersMatch.php.php8	2020-01-08 09:45:45.000000000 +0100
+++ ./src/Framework/MockObject/Builder/ParametersMatch.php	2021-03-24 14:30:25.218737051 +0100
@@ -14,7 +14,7 @@ use PHPUnit\Framework\MockObject\Matcher
 /**
  * Builder interface for parameter matchers.
  */
-interface ParametersMatch extends Match
+interface ParametersMatch extends Match_
 {
     /**
      * Sets the parameters to match for, each parameter to this function will
diff -up ./src/Framework/MockObject/Generator.php.php8 ./src/Framework/MockObject/Generator.php
diff -up ./src/Framework/MockObject/InvocationMocker.php.php8 ./src/Framework/MockObject/InvocationMocker.php
--- ./src/Framework/MockObject/InvocationMocker.php.php8	2020-01-08 09:45:45.000000000 +0100
+++ ./src/Framework/MockObject/InvocationMocker.php	2021-03-24 14:30:25.218737051 +0100
@@ -12,7 +12,7 @@ namespace PHPUnit\Framework\MockObject;
 use Exception;
 use PHPUnit\Framework\ExpectationFailedException;
 use PHPUnit\Framework\MockObject\Builder\InvocationMocker as BuilderInvocationMocker;
-use PHPUnit\Framework\MockObject\Builder\Match;
+use PHPUnit\Framework\MockObject\Builder\Match_;
 use PHPUnit\Framework\MockObject\Builder\NamespaceMatch;
 use PHPUnit\Framework\MockObject\Matcher\DeferredError;
 use PHPUnit\Framework\MockObject\Matcher\Invocation as MatcherInvocation;
@@ -82,7 +82,7 @@ class InvocationMocker implements Invoka
     /**
      * @throws RuntimeException
      */
-    public function registerId($id, Match $builder): void
+    public function registerId($id, Match_ $builder): void
     {
         if (isset($this->builderMap[$id])) {
             throw new RuntimeException(
diff -up ./src/Framework/MockObject/MockMethod.php.php8 ./src/Framework/MockObject/MockMethod.php
--- ./src/Framework/MockObject/MockMethod.php.php8	2020-01-08 09:45:45.000000000 +0100
+++ ./src/Framework/MockObject/MockMethod.php	2021-03-24 14:30:25.218737051 +0100
@@ -301,11 +301,11 @@ final class MockMethod
                     $nullable = '?';
                 }
 
-                if ($parameter->hasType() && $parameter->getType()->getName() !== 'self') {
+                if ($parameter->hasType() && (($t=$parameter->getType()) instanceof ReflectionNamedType) && $t->getName() !== 'self') {
                     $typeDeclaration = $parameter->getType()->getName() . ' ';
                 } else {
                     try {
-                        $class = $parameter->getClass();
+                        $class = @$parameter->getClass();
                     } catch (ReflectionException $e) {
                         throw new RuntimeException(
                             \sprintf(
diff -up ./tests/_files/SingletonClass.php.php8 ./tests/_files/SingletonClass.php
--- ./tests/_files/SingletonClass.php.php8	2021-03-24 14:33:54.292214558 +0100
+++ ./tests/_files/SingletonClass.php	2021-03-24 14:37:50.093575868 +0100
@@ -17,11 +17,11 @@ class SingletonClass
     {
     }
 
-    private function __sleep()
+    function __sleep()
     {
     }
 
-    private function __wakeup()
+    function __wakeup()
     {
     }
 
diff -up ./tests/unit/Framework/Constraint/IsTypeTest.php.php8 ./tests/unit/Framework/Constraint/IsTypeTest.php
--- ./tests/unit/Framework/Constraint/IsTypeTest.php.php8	2020-01-08 09:45:45.000000000 +0100
+++ ./tests/unit/Framework/Constraint/IsTypeTest.php	2021-03-24 14:30:25.219737049 +0100
@@ -74,7 +74,7 @@ EOF
 
         $this->assertTrue($constraint->evaluate($resource, '', true));
 
-        @\fclose($resource);
+        if (is_resource($resource)) @\fclose($resource);
     }
 
     public function resources()
diff -up ./tests/unit/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php.php8 ./tests/unit/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php
--- ./tests/unit/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php.php8	2020-01-08 09:45:45.000000000 +0100
+++ ./tests/unit/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php	2021-03-24 14:30:25.219737049 +0100
@@ -17,7 +17,7 @@ class JsonMatchesErrorMessageProviderTes
     {
         return [
             'JSON_ERROR_NONE'  => [
-                null, 'json_error_none', '',
+                null, \JSON_ERROR_NONE, '',
             ],
             'JSON_ERROR_DEPTH' => [
                 'Maximum stack depth exceeded', \JSON_ERROR_DEPTH, '',