Page MenuHomeDevCentral

Fix tests for PHPUnit 12
Closed, ResolvedPublic

Description

There is an issue in OmniTools tests for data providers.

PHPUnit 12 seems to want a match between the number of arguments available in an data provider array row and the number of arguments the test function receive.

1Switching to Composer phpunit:
2PHPUnit 12.5-dev by Sebastian Bergmann and contributors.
3
4Runtime: PHP 8.3.27
5Configuration: /home/dereckson/dev/keruald/_monorepo/core/phpunit.xml
6
7W..SSSSSSSSSSSSSSSSSS.......................................... 63 / 909 ( 6%)
8..........................SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS..... 126 / 909 ( 13%)
9.........................NNNNNNNNNNNN.......................... 189 / 909 ( 20%)
10............................................................... 252 / 909 ( 27%)
11............................................................... 315 / 909 ( 34%)
12............................................................... 378 / 909 ( 41%)
13............................................................... 441 / 909 ( 48%)
14............................................................... 504 / 909 ( 55%)
15............................................................... 567 / 909 ( 62%)
16............................................................... 630 / 909 ( 69%)
17............................................................... 693 / 909 ( 76%)
18............................................................... 756 / 909 ( 83%)
19............................................................... 819 / 909 ( 90%)
20............................................................... 882 / 909 ( 97%)
21........................... 909 / 909 (100%)
22
23Time: 00:02.182, Memory: 24.00 MB
24
255 tests triggered 23 PHPUnit warnings:
26
271) Keruald\OmniTools\Tests\HTTP\URLTest::testGetDomain
28* Data set #0 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (2)
29
30* Data set #1 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (2)
31
32* Data set #2 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (2)
33
34* Data set #3 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (2)
35
36* Data set #4 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (2)
37
38* Data set #5 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (2)
39
40* Data set #6 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (5) than the test method accepts (2)
41
42/home/dereckson/dev/keruald/_monorepo/core/omnitools/tests/HTTP/URLTest.php:13
43
442) Keruald\OmniTools\Tests\HTTP\URLTest::testGetProtocol
45* Data set #0 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (3)
46
47* Data set #1 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (3)
48
49* Data set #2 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (3)
50
51* Data set #3 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (3)
52
53* Data set #4 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (3)
54
55* Data set #5 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (4) than the test method accepts (3)
56
57* Data set #6 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (5) than the test method accepts (3)
58
59/home/dereckson/dev/keruald/_monorepo/core/omnitools/tests/HTTP/URLTest.php:20
60
613) Keruald\OmniTools\Tests\HTTP\URLTest::testGetQuery
62Data set #6 provided by Keruald\OmniTools\Tests\HTTP\URLTest::provideURLsAndComponents has more arguments (5) than the test method accepts (4)
63
64/home/dereckson/dev/keruald/_monorepo/core/omnitools/tests/HTTP/URLTest.php:27
65
664) Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::testEncodeInBase64
67* Data set #0 provided by Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::provideBase64 has more arguments (3) than the test method accepts (2)
68
69* Data set #1 provided by Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::provideBase64 has more arguments (3) than the test method accepts (2)
70
71* Data set #2 provided by Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::provideBase64 has more arguments (3) than the test method accepts (2)
72
73* Data set #3 provided by Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::provideBase64 has more arguments (3) than the test method accepts (2)
74
75/home/dereckson/dev/keruald/_monorepo/core/omnitools/tests/Strings/Multibyte/StringUtilitiesTest.php:56
76
775) Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::testDecodeFromBase64
78* Data set #0 provided by Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::provideBase64 has more arguments (3) than the test method accepts (2)
79
80* Data set #1 provided by Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::provideBase64 has more arguments (3) than the test method accepts (2)
81
82* Data set #2 provided by Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::provideBase64 has more arguments (3) than the test method accepts (2)
83
84* Data set #3 provided by Keruald\OmniTools\Tests\Strings\Multibyte\StringUtilitiesTest::provideBase64 has more arguments (3) than the test method accepts (2)
85
86/home/dereckson/dev/keruald/_monorepo/core/omnitools/tests/Strings/Multibyte/StringUtilitiesTest.php:62
87
88OK, but there were issues!
89Tests: 909, Assertions: 2237, PHPUnit Warnings: 5, PHPUnit Notices: 12, Skipped: 50.

Related Objects