File: 0004-Make-provider-functions-static-PHPUnit-11-Fix.patch

package info (click to toggle)
php-faker 1.20.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,704 kB
  • sloc: php: 115,692; xml: 213; makefile: 49
file content (402 lines) | stat: -rw-r--r-- 14,297 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Fri, 11 Oct 2024 13:02:50 +0100
Subject: Make provider functions static (PHPUnit 11 Fix)

Bug-Debian: https://bugs.debian.org/1070542
---
 test/Faker/Calculator/EanTest.php             |  8 ++++----
 test/Faker/Calculator/IbanTest.php            |  8 ++++----
 test/Faker/Calculator/IsbnTest.php            |  4 ++--
 test/Faker/Calculator/LuhnTest.php            |  4 ++--
 test/Faker/Extension/ContainerBuilderTest.php |  2 +-
 test/Faker/Extension/ContainerTest.php        |  2 +-
 test/Faker/Provider/BaseTest.php              |  4 ++--
 test/Faker/Provider/DateTimeTest.php          |  4 ++--
 test/Faker/Provider/PaymentTest.php           |  4 ++--
 test/Faker/Provider/PersonTest.php            |  4 ++--
 test/Faker/Provider/en_US/PaymentTest.php     |  2 +-
 test/Faker/Provider/fi_FI/PersonTest.php      |  2 +-
 test/Faker/Provider/ro_RO/PersonTest.php      | 12 ++++++------
 test/Faker/Provider/ru_RU/CompanyTest.php     |  4 ++--
 test/Faker/Provider/sv_SE/PersonTest.php      |  2 +-
 test/Faker/Provider/tr_TR/PersonTest.php      |  4 ++--
 16 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/test/Faker/Calculator/EanTest.php b/test/Faker/Calculator/EanTest.php
index 704ee31..a585af8 100644
--- a/test/Faker/Calculator/EanTest.php
+++ b/test/Faker/Calculator/EanTest.php
@@ -7,7 +7,7 @@ use Faker\Test\TestCase;
 
 final class EanTest extends TestCase
 {
-    public function Ean8checksumProvider()
+    public static function Ean8checksumProvider()
     {
         return [
             ['1234567', 0],
@@ -16,7 +16,7 @@ final class EanTest extends TestCase
         ];
     }
 
-    public function ean8ValidationProvider()
+    public static function ean8ValidationProvider()
     {
         return [
             ['1234567891231', true],
@@ -43,7 +43,7 @@ final class EanTest extends TestCase
         self::assertSame($valid, Ean::isValid($ean8));
     }
 
-    public function Ean13checksumProvider()
+    public static function Ean13checksumProvider()
     {
         return [
             ['123456789123', 1],
@@ -54,7 +54,7 @@ final class EanTest extends TestCase
         ];
     }
 
-    public function ean13ValidationProvider()
+    public static function ean13ValidationProvider()
     {
         return [
             ['1234567891231', true],
diff --git a/test/Faker/Calculator/IbanTest.php b/test/Faker/Calculator/IbanTest.php
index 4ed7a57..eab2ce4 100644
--- a/test/Faker/Calculator/IbanTest.php
+++ b/test/Faker/Calculator/IbanTest.php
@@ -7,7 +7,7 @@ use Faker\Test\TestCase;
 
 final class IbanTest extends TestCase
 {
-    public function checksumProvider()
+    public static function checksumProvider()
     {
         return [
             ['AL47212110090000000235698741',           '47'],
@@ -88,7 +88,7 @@ final class IbanTest extends TestCase
         self::assertEquals($checksum, Iban::checksum($iban), $iban);
     }
 
-    public function validatorProvider()
+    public static function validatorProvider()
     {
         return [
             ['AL47212110090000000235698741',           true],
@@ -237,7 +237,7 @@ final class IbanTest extends TestCase
         self::assertEquals($isValid, Iban::isValid($iban), $iban);
     }
 
-    public function alphaToNumberProvider()
+    public static function alphaToNumberProvider()
     {
         return [
             ['A', 10],
@@ -277,7 +277,7 @@ final class IbanTest extends TestCase
         self::assertEquals($number, Iban::alphaToNumber($letter), $letter);
     }
 
-    public function mod97Provider()
+    public static function mod97Provider()
     {
         // Large numbers
         $return = [
diff --git a/test/Faker/Calculator/IsbnTest.php b/test/Faker/Calculator/IsbnTest.php
index 3e41e7c..47f47ab 100644
--- a/test/Faker/Calculator/IsbnTest.php
+++ b/test/Faker/Calculator/IsbnTest.php
@@ -7,7 +7,7 @@ use Faker\Test\TestCase;
 
 final class IsbnTest extends TestCase
 {
-    public function isbnChecksumProvider(): iterable
+    public static function isbnChecksumProvider(): iterable
     {
         yield ['997150210', '0'];
 
@@ -16,7 +16,7 @@ final class IsbnTest extends TestCase
         yield ['960425059', '0'];
     }
 
-    public function isbnValidationProvider(): iterable
+    public static function isbnValidationProvider(): iterable
     {
         yield ['9971502100', true];
 
diff --git a/test/Faker/Calculator/LuhnTest.php b/test/Faker/Calculator/LuhnTest.php
index 1adb810..b9b5c1d 100644
--- a/test/Faker/Calculator/LuhnTest.php
+++ b/test/Faker/Calculator/LuhnTest.php
@@ -7,7 +7,7 @@ use Faker\Test\TestCase;
 
 final class LuhnTest extends TestCase
 {
-    public function checkDigitProvider()
+    public static function checkDigitProvider()
     {
         return [
             ['7992739871', '3'],
@@ -34,7 +34,7 @@ final class LuhnTest extends TestCase
         self::assertEquals($checkDigit, Luhn::computeCheckDigit($partialNumber));
     }
 
-    public function validatorProvider()
+    public static function validatorProvider()
     {
         return [
             ['79927398710', false],
diff --git a/test/Faker/Extension/ContainerBuilderTest.php b/test/Faker/Extension/ContainerBuilderTest.php
index a97415d..155faa7 100644
--- a/test/Faker/Extension/ContainerBuilderTest.php
+++ b/test/Faker/Extension/ContainerBuilderTest.php
@@ -36,7 +36,7 @@ final class ContainerBuilderTest extends TestCase
     /**
      * @return \Generator<string, array{0: array|bool|float|int|null|resource}>
      */
-    public function provideInvalidValue(): \Generator
+    public static function provideInvalidValue(): \Generator
     {
         $values = [
             'array' => [
diff --git a/test/Faker/Extension/ContainerTest.php b/test/Faker/Extension/ContainerTest.php
index 069fa2b..45eada2 100644
--- a/test/Faker/Extension/ContainerTest.php
+++ b/test/Faker/Extension/ContainerTest.php
@@ -67,7 +67,7 @@ final class ContainerTest extends TestCase
     /**
      * @return \Generator<string, array{0: callable|object|string}>
      */
-    public function provideDefinitionThatDoesNotResolveToExtension(): \Generator
+    public static function provideDefinitionThatDoesNotResolveToExtension(): \Generator
     {
         $definitions = [
             'callable' => static function (): \stdClass {
diff --git a/test/Faker/Provider/BaseTest.php b/test/Faker/Provider/BaseTest.php
index 3af3de2..08c72c1 100644
--- a/test/Faker/Provider/BaseTest.php
+++ b/test/Faker/Provider/BaseTest.php
@@ -305,7 +305,7 @@ final class BaseTest extends TestCase
         self::assertMatchesRegularExpression('/foo.Ba.r/', BaseProvider::asciify('foo*Ba*r'));
     }
 
-    public function regexifyBasicDataProvider()
+    public static function regexifyBasicDataProvider()
     {
         return [
             ['azeQSDF1234', 'azeQSDF1234', 'does not change non regex chars'],
@@ -324,7 +324,7 @@ final class BaseTest extends TestCase
         self::assertEquals($output, BaseProvider::regexify($input), $message);
     }
 
-    public function regexifyDataProvider()
+    public static function regexifyDataProvider()
     {
         return [
             ['\d', 'numbers'],
diff --git a/test/Faker/Provider/DateTimeTest.php b/test/Faker/Provider/DateTimeTest.php
index a0cafc5..992dac9 100644
--- a/test/Faker/Provider/DateTimeTest.php
+++ b/test/Faker/Provider/DateTimeTest.php
@@ -197,7 +197,7 @@ final class DateTimeTest extends TestCase
         self::assertEquals(new \DateTimeZone($this->defaultTz), $date->getTimezone());
     }
 
-    public function providerDateTimeBetween()
+    public static function providerDateTimeBetween()
     {
         return [
             ['-1 year', false],
@@ -227,7 +227,7 @@ final class DateTimeTest extends TestCase
         }
     }
 
-    public function providerDateTimeInInterval()
+    public static function providerDateTimeInInterval()
     {
         return [
             ['-1 year', '+5 days', true],
diff --git a/test/Faker/Provider/PaymentTest.php b/test/Faker/Provider/PaymentTest.php
index f564d07..438d214 100644
--- a/test/Faker/Provider/PaymentTest.php
+++ b/test/Faker/Provider/PaymentTest.php
@@ -20,7 +20,7 @@ final class PaymentTest extends TestCase
         self::assertContains($this->faker->creditCardType, ['Visa', 'Visa Retired', 'MasterCard', 'American Express', 'Discover Card', 'JCB']);
     }
 
-    public function creditCardNumberProvider()
+    public static function creditCardNumberProvider()
     {
         return [
             ['Discover Card', '/^6011\d{12}$/'],
@@ -174,7 +174,7 @@ final class PaymentTest extends TestCase
     }
 
     /**
-     * @dataProvider ibanFormatProvider
+     * @group nophpunit11
      */
     public function testIban($countryCode, $regex)
     {
diff --git a/test/Faker/Provider/PersonTest.php b/test/Faker/Provider/PersonTest.php
index 469c25f..c1c14a5 100644
--- a/test/Faker/Provider/PersonTest.php
+++ b/test/Faker/Provider/PersonTest.php
@@ -18,7 +18,7 @@ final class PersonTest extends TestCase
         self::assertContains($this->faker->firstName($gender), $expected);
     }
 
-    public function firstNameProvider()
+    public static function firstNameProvider()
     {
         return [
             [null, ['John', 'Jane']],
@@ -46,7 +46,7 @@ final class PersonTest extends TestCase
         self::assertContains($this->faker->title($gender), $expected);
     }
 
-    public function titleProvider()
+    public static function titleProvider()
     {
         return [
             [null, ['Mr.', 'Mrs.', 'Ms.', 'Miss', 'Dr.', 'Prof.']],
diff --git a/test/Faker/Provider/en_US/PaymentTest.php b/test/Faker/Provider/en_US/PaymentTest.php
index 38641c2..7d7b236 100644
--- a/test/Faker/Provider/en_US/PaymentTest.php
+++ b/test/Faker/Provider/en_US/PaymentTest.php
@@ -23,7 +23,7 @@ final class PaymentTest extends TestCase
         self::assertEquals(Payment::calculateRoutingNumberChecksum($routingNo), $routingNo[8]);
     }
 
-    public function routingNumberProvider()
+    public static function routingNumberProvider()
     {
         return [
             ['122105155'],
diff --git a/test/Faker/Provider/fi_FI/PersonTest.php b/test/Faker/Provider/fi_FI/PersonTest.php
index fe56e40..ef919d3 100644
--- a/test/Faker/Provider/fi_FI/PersonTest.php
+++ b/test/Faker/Provider/fi_FI/PersonTest.php
@@ -11,7 +11,7 @@ use Faker\Test\TestCase;
  */
 final class PersonTest extends TestCase
 {
-    public function provideSeedAndExpectedReturn()
+    public static function provideSeedAndExpectedReturn()
     {
         return [
             [1, '1800-01-01', '010100+5207'],
diff --git a/test/Faker/Provider/ro_RO/PersonTest.php b/test/Faker/Provider/ro_RO/PersonTest.php
index e10b5e6..21e8758 100644
--- a/test/Faker/Provider/ro_RO/PersonTest.php
+++ b/test/Faker/Provider/ro_RO/PersonTest.php
@@ -19,7 +19,7 @@ final class PersonTest extends TestCase
         $this->skipOn32bitSystem();
     }
 
-    public function invalidGenderProvider()
+    public static function invalidGenderProvider()
     {
         return [
             ['elf'],
@@ -29,7 +29,7 @@ final class PersonTest extends TestCase
         ];
     }
 
-    public function invalidYearProvider()
+    public static function invalidYearProvider()
     {
         return [
             [1652],
@@ -39,7 +39,7 @@ final class PersonTest extends TestCase
         ];
     }
 
-    public function validYearProvider()
+    public static function validYearProvider()
     {
         return [
             [null],
@@ -53,7 +53,7 @@ final class PersonTest extends TestCase
         ];
     }
 
-    public function validCountyCodeProvider()
+    public static function validCountyCodeProvider()
     {
         return [
             ['AB'], ['AR'], ['AG'], ['B'], ['BC'], ['BH'], ['BN'], ['BT'],
@@ -65,14 +65,14 @@ final class PersonTest extends TestCase
         ];
     }
 
-    public function invalidCountyCodeProvider()
+    public static function invalidCountyCodeProvider()
     {
         return [
             ['JK'], ['REW'], ['x'], ['FF'], ['aaaddadaada'],
         ];
     }
 
-    public function validInputDataProvider()
+    public static function validInputDataProvider()
     {
         return [
             [Person::GENDER_MALE, '1981-06-16', 'B2', true, '181061642'],
diff --git a/test/Faker/Provider/ru_RU/CompanyTest.php b/test/Faker/Provider/ru_RU/CompanyTest.php
index 614f371..d165344 100644
--- a/test/Faker/Provider/ru_RU/CompanyTest.php
+++ b/test/Faker/Provider/ru_RU/CompanyTest.php
@@ -36,7 +36,7 @@ final class CompanyTest extends TestCase
         );
     }
 
-    public function checksumProvider()
+    public static function checksumProvider()
     {
         return [
             ['143525744', '4'],
@@ -55,7 +55,7 @@ final class CompanyTest extends TestCase
         self::assertSame($checksum, $this->faker->inn10Checksum($inn10), $inn10);
     }
 
-    public function inn10ValidatorProvider()
+    public static function inn10ValidatorProvider()
     {
         return [
             ['5902179757', true],
diff --git a/test/Faker/Provider/sv_SE/PersonTest.php b/test/Faker/Provider/sv_SE/PersonTest.php
index db08d5b..ea97234 100644
--- a/test/Faker/Provider/sv_SE/PersonTest.php
+++ b/test/Faker/Provider/sv_SE/PersonTest.php
@@ -11,7 +11,7 @@ use Faker\Test\TestCase;
  */
 final class PersonTest extends TestCase
 {
-    public function provideSeedAndExpectedReturn()
+    public static function provideSeedAndExpectedReturn()
     {
         return [
             [1, '720727', '720727-5798'],
diff --git a/test/Faker/Provider/tr_TR/PersonTest.php b/test/Faker/Provider/tr_TR/PersonTest.php
index ab5aeb9..30ed38e 100644
--- a/test/Faker/Provider/tr_TR/PersonTest.php
+++ b/test/Faker/Provider/tr_TR/PersonTest.php
@@ -20,7 +20,7 @@ final class PersonTest extends TestCase
         }
     }
 
-    public function tcNoChecksumProvider()
+    public static function tcNoChecksumProvider()
     {
         return [
             ['553006348', '82'],
@@ -42,7 +42,7 @@ final class PersonTest extends TestCase
         self::assertSame($checksum, $this->faker->tcNoChecksum($tcNo), $tcNo);
     }
 
-    public function tcNoValidatorProvider()
+    public static function tcNoValidatorProvider()
     {
         return [
             ['22978160678', true],