File: 0001-Make-provider-classes-static-PHPUnit-11-fix.patch

package info (click to toggle)
php-webmozart-assert 1.11.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 976 kB
  • sloc: php: 6,095; xml: 16; makefile: 13
file content (175 lines) | stat: -rw-r--r-- 4,638 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sat, 18 May 2024 13:35:51 +0200
Subject: Make provider classes static (PHPUnit 11 fix)

https://bugs.debian.org/1070612
---
 tests/AssertTest.php      | 20 ++++++++++----------
 tests/ProjectCodeTest.php | 16 ++++++++--------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/tests/AssertTest.php b/tests/AssertTest.php
index 567fddf..59c9b7b 100644
--- a/tests/AssertTest.php
+++ b/tests/AssertTest.php
@@ -44,10 +44,10 @@ class AssertTest extends TestCase
      */
     public static function doTearDownAfterClass()
     {
-        @fclose(self::$resource);
+        //@fclose(self::$resource);
     }
 
-    public function getTests()
+    public static function getTests()
     {
         $resource = self::getResource();
 
@@ -603,7 +603,7 @@ class AssertTest extends TestCase
     }
 
     /**
-     * @dataProvider getTests
+     * @group nophpunit11
      */
     public function testAssert($method, $args, $success, $multibyte = false, $minVersion = null)
     {
@@ -625,7 +625,7 @@ class AssertTest extends TestCase
     }
 
     /**
-     * @dataProvider getTests
+     * @group nophpunit11
      */
     public function testNullOr($method, $args, $success, $multibyte = false, $minVersion = null)
     {
@@ -647,7 +647,7 @@ class AssertTest extends TestCase
     }
 
     /**
-     * @dataProvider getMethods
+     * @group nophpunit11
      */
     public function testNullOrAcceptsNull($method)
     {
@@ -656,7 +656,7 @@ class AssertTest extends TestCase
     }
 
     /**
-     * @dataProvider getTests
+     * @group nophpunit11
      */
     public function testAllArray($method, $args, $success, $multibyte = false, $minVersion = null)
     {
@@ -681,7 +681,7 @@ class AssertTest extends TestCase
     }
 
     /**
-     * @dataProvider getTests
+     * @group nophpunit11
      */
     public function testAllNullOrArray($method, $args, $success, $multibyte = false, $minVersion = null)
     {
@@ -713,7 +713,7 @@ class AssertTest extends TestCase
     }
 
     /**
-     * @dataProvider getTests
+     * @group nophpunit11
      */
     public function testAllTraversable($method, $args, $success, $multibyte = false, $minVersion = null)
     {
@@ -763,7 +763,7 @@ class AssertTest extends TestCase
     }
 
     /**
-     * @dataProvider getStringConversions
+     * @group nophpunit11
      */
     public function testConvertValuesToStrings($method, $args, $exceptionMessage)
     {
@@ -809,7 +809,7 @@ class AssertTest extends TestCase
     }
 
     /**
-     * @dataProvider getInvalidIsAOfCases
+     * @group nophpunit11
      */
     public function testIsAOfExceptionMessages(array $args, string $exceptionMessage): void
     {
diff --git a/tests/ProjectCodeTest.php b/tests/ProjectCodeTest.php
index 3e8ef63..a0c2fe7 100644
--- a/tests/ProjectCodeTest.php
+++ b/tests/ProjectCodeTest.php
@@ -33,7 +33,7 @@ class ProjectCodeTest extends TestCase
     }
 
     /**
-     * @dataProvider providesMethodNames
+     * @group nophpunit11
      *
      * @param string $method
      */
@@ -62,7 +62,7 @@ class ProjectCodeTest extends TestCase
     }
 
     /**
-     * @dataProvider providesMethodNames
+     * @group nophpunit11
      *
      * @param string $method
      */
@@ -86,7 +86,7 @@ class ProjectCodeTest extends TestCase
     }
 
     /**
-     * @dataProvider providesMethodNames
+     * @group nophpunit11
      *
      * @param string $method
      */
@@ -104,7 +104,7 @@ class ProjectCodeTest extends TestCase
     }
 
     /**
-     * @dataProvider provideMethods
+     * @group nophpunit11
      *
      * @param ReflectionMethod $method
      */
@@ -131,7 +131,7 @@ class ProjectCodeTest extends TestCase
     }
 
     /**
-     * @dataProvider provideMethods
+     * @group nophpunit11
      *
      * @param ReflectionMethod $method
      */
@@ -170,7 +170,7 @@ class ProjectCodeTest extends TestCase
     /**
      * @return array
      */
-    public function providesMethodNames()
+    public static function providesMethodNames()
     {
         return array_map(function ($value) {
             return array($value->getName());
@@ -180,7 +180,7 @@ class ProjectCodeTest extends TestCase
     /**
      * @return array
      */
-    public function provideMethods()
+    public static function provideMethods()
     {
         return array_map(function ($value) {
             return array($value);
@@ -190,7 +190,7 @@ class ProjectCodeTest extends TestCase
     /**
      * @return array
      */
-    private function getMethods()
+    private static function getMethods()
     {
         static $methods;