Skip to content

Commit 5c45ef1

Browse files
authored
Merge pull request #8069 from kenjis/update-phpunit-10
refactor: update PHPUnit to 10
2 parents 77cbf2c + 9e009e9 commit 5c45ef1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+316
-235
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,6 @@ nb-configuration.xml
126126
/results/
127127
/phpunit*.xml
128128
/.phpunit.*.cache
129+
/.phpunit.cache
129130

130131
/.php-cs-fixer.php

admin/framework/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"kint-php/kint": "^5.0.4",
2424
"mikey179/vfsstream": "^1.6",
2525
"nexusphp/cs-config": "^3.6",
26-
"phpunit/phpunit": "^9.1",
26+
"phpunit/phpunit": "^10.5.16",
2727
"predis/predis": "^1.1 || ^2.0"
2828
},
2929
"suggest": {

admin/framework/phpunit.xml.dist

Lines changed: 39 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,48 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
bootstrap="system/Test/bootstrap.php"
4-
backupGlobals="false"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
stopOnError="false"
10-
stopOnFailure="false"
11-
stopOnIncomplete="false"
12-
stopOnSkipped="false"
13-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
14-
<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
15-
<include>
16-
<directory suffix=".php">./app</directory>
17-
</include>
18-
<exclude>
19-
<directory suffix=".php">./app/Views</directory>
20-
<file>./app/Config/Routes.php</file>
21-
</exclude>
22-
<report>
23-
<clover outputFile="build/logs/clover.xml"/>
24-
<html outputDirectory="build/logs/html"/>
25-
<php outputFile="build/logs/coverage.serialized"/>
26-
<text outputFile="php://stdout" showUncoveredFiles="false"/>
27-
</report>
28-
</coverage>
29-
<testsuites>
30-
<testsuite name="App">
31-
<directory>./tests</directory>
32-
</testsuite>
33-
</testsuites>
34-
<logging>
35-
<testdoxHtml outputFile="build/logs/testdox.html"/>
36-
<testdoxText outputFile="build/logs/testdox.txt"/>
37-
<junit outputFile="build/logs/logfile.xml"/>
38-
</logging>
39-
<php>
40-
<server name="app.baseURL" value="http://example.com/"/>
41-
<!-- Directory containing phpunit.xml -->
42-
<const name="HOMEPATH" value="./"/>
43-
<!-- Directory containing the Paths config file -->
44-
<const name="CONFIGPATH" value="./app/Config/"/>
45-
<!-- Directory containing the front controller (index.php) -->
46-
<const name="PUBLICPATH" value="./public/"/>
47-
<!-- Database configuration -->
48-
<!-- Uncomment to provide your own database for testing
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="system/Test/bootstrap.php" backupGlobals="false" colors="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
3+
<coverage includeUncoveredFiles="true">
4+
<report>
5+
<clover outputFile="build/logs/clover.xml"/>
6+
<html outputDirectory="build/logs/html"/>
7+
<php outputFile="build/logs/coverage.serialized"/>
8+
<text outputFile="php://stdout" showUncoveredFiles="false"/>
9+
</report>
10+
</coverage>
11+
<testsuites>
12+
<testsuite name="App">
13+
<directory>./tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
<logging>
17+
<testdoxHtml outputFile="build/logs/testdox.html"/>
18+
<testdoxText outputFile="build/logs/testdox.txt"/>
19+
<junit outputFile="build/logs/logfile.xml"/>
20+
</logging>
21+
<php>
22+
<server name="app.baseURL" value="http://example.com/"/>
23+
<!-- Directory containing phpunit.xml -->
24+
<const name="HOMEPATH" value="./"/>
25+
<!-- Directory containing the Paths config file -->
26+
<const name="CONFIGPATH" value="./app/Config/"/>
27+
<!-- Directory containing the front controller (index.php) -->
28+
<const name="PUBLICPATH" value="./public/"/>
29+
<!-- Database configuration -->
30+
<!-- Uncomment to provide your own database for testing
4931
<env name="database.tests.hostname" value="localhost"/>
5032
<env name="database.tests.database" value="tests"/>
5133
<env name="database.tests.username" value="tests_user"/>
5234
<env name="database.tests.password" value=""/>
5335
<env name="database.tests.DBDriver" value="MySQLi"/>
5436
<env name="database.tests.DBPrefix" value="tests_"/>
5537
-->
56-
</php>
38+
</php>
39+
<source>
40+
<include>
41+
<directory suffix=".php">./app</directory>
42+
</include>
43+
<exclude>
44+
<directory suffix=".php">./app/Views</directory>
45+
<file>./app/Config/Routes.php</file>
46+
</exclude>
47+
</source>
5748
</phpunit>

admin/starter/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"require-dev": {
1717
"fakerphp/faker": "^1.9",
1818
"mikey179/vfsstream": "^1.6",
19-
"phpunit/phpunit": "^9.1"
19+
"phpunit/phpunit": "^10.5.16"
2020
},
2121
"autoload": {
2222
"psr-4": {

admin/starter/phpunit.xml.dist

Lines changed: 39 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,48 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
4-
backupGlobals="false"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
stopOnError="false"
10-
stopOnFailure="false"
11-
stopOnIncomplete="false"
12-
stopOnSkipped="false"
13-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
14-
<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
15-
<include>
16-
<directory suffix=".php">./app</directory>
17-
</include>
18-
<exclude>
19-
<directory suffix=".php">./app/Views</directory>
20-
<file>./app/Config/Routes.php</file>
21-
</exclude>
22-
<report>
23-
<clover outputFile="build/logs/clover.xml"/>
24-
<html outputDirectory="build/logs/html"/>
25-
<php outputFile="build/logs/coverage.serialized"/>
26-
<text outputFile="php://stdout" showUncoveredFiles="false"/>
27-
</report>
28-
</coverage>
29-
<testsuites>
30-
<testsuite name="App">
31-
<directory>./tests</directory>
32-
</testsuite>
33-
</testsuites>
34-
<logging>
35-
<testdoxHtml outputFile="build/logs/testdox.html"/>
36-
<testdoxText outputFile="build/logs/testdox.txt"/>
37-
<junit outputFile="build/logs/logfile.xml"/>
38-
</logging>
39-
<php>
40-
<server name="app.baseURL" value="http://example.com/"/>
41-
<!-- Directory containing phpunit.xml -->
42-
<const name="HOMEPATH" value="./"/>
43-
<!-- Directory containing the Paths config file -->
44-
<const name="CONFIGPATH" value="./app/Config/"/>
45-
<!-- Directory containing the front controller (index.php) -->
46-
<const name="PUBLICPATH" value="./public/"/>
47-
<!-- Database configuration -->
48-
<!-- Uncomment to provide your own database for testing
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php" backupGlobals="false" colors="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
3+
<coverage includeUncoveredFiles="true">
4+
<report>
5+
<clover outputFile="build/logs/clover.xml"/>
6+
<html outputDirectory="build/logs/html"/>
7+
<php outputFile="build/logs/coverage.serialized"/>
8+
<text outputFile="php://stdout" showUncoveredFiles="false"/>
9+
</report>
10+
</coverage>
11+
<testsuites>
12+
<testsuite name="App">
13+
<directory>./tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
<logging>
17+
<testdoxHtml outputFile="build/logs/testdox.html"/>
18+
<testdoxText outputFile="build/logs/testdox.txt"/>
19+
<junit outputFile="build/logs/logfile.xml"/>
20+
</logging>
21+
<php>
22+
<server name="app.baseURL" value="http://example.com/"/>
23+
<!-- Directory containing phpunit.xml -->
24+
<const name="HOMEPATH" value="./"/>
25+
<!-- Directory containing the Paths config file -->
26+
<const name="CONFIGPATH" value="./app/Config/"/>
27+
<!-- Directory containing the front controller (index.php) -->
28+
<const name="PUBLICPATH" value="./public/"/>
29+
<!-- Database configuration -->
30+
<!-- Uncomment to provide your own database for testing
4931
<env name="database.tests.hostname" value="localhost"/>
5032
<env name="database.tests.database" value="tests"/>
5133
<env name="database.tests.username" value="tests_user"/>
5234
<env name="database.tests.password" value=""/>
5335
<env name="database.tests.DBDriver" value="MySQLi"/>
5436
<env name="database.tests.DBPrefix" value="tests_"/>
5537
-->
56-
</php>
38+
</php>
39+
<source>
40+
<include>
41+
<directory suffix=".php">./app</directory>
42+
</include>
43+
<exclude>
44+
<directory suffix=".php">./app/Views</directory>
45+
<file>./app/Config/Routes.php</file>
46+
</exclude>
47+
</source>
5748
</phpunit>

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"kint-php/kint": "^5.0.4",
2626
"mikey179/vfsstream": "^1.6",
2727
"nexusphp/cs-config": "^3.6",
28-
"nexusphp/tachycardia": "^1.0",
28+
"nexusphp/tachycardia": "^2.0",
2929
"phpstan/extension-installer": "^1.3",
3030
"phpstan/phpstan": "^1.10.2",
3131
"phpstan/phpstan-strict-rules": "^1.5",
32-
"phpunit/phpcov": "^8.2",
33-
"phpunit/phpunit": "^9.1",
32+
"phpunit/phpcov": "^9.0.2",
33+
"phpunit/phpunit": "^10.5.16",
3434
"predis/predis": "^1.1 || ^2.0",
3535
"rector/rector": "1.0.4",
3636
"vimeo/psalm": "^5.0"

phpstan-baseline.php

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11196,26 +11196,6 @@
1119611196
'count' => 1,
1119711197
'path' => __DIR__ . '/tests/system/Cache/FactoriesCacheFileVarExportHandlerTest.php',
1119811198
];
11199-
$ignoreErrors[] = [
11200-
'message' => '#^Property CodeIgniter\\\\Cache\\\\Handlers\\\\AbstractHandlerTest\\:\\:\\$dummy has no type specified\\.$#',
11201-
'count' => 1,
11202-
'path' => __DIR__ . '/tests/system/Cache/Handlers/AbstractHandlerTest.php',
11203-
];
11204-
$ignoreErrors[] = [
11205-
'message' => '#^Property CodeIgniter\\\\Cache\\\\Handlers\\\\AbstractHandlerTest\\:\\:\\$key1 has no type specified\\.$#',
11206-
'count' => 1,
11207-
'path' => __DIR__ . '/tests/system/Cache/Handlers/AbstractHandlerTest.php',
11208-
];
11209-
$ignoreErrors[] = [
11210-
'message' => '#^Property CodeIgniter\\\\Cache\\\\Handlers\\\\AbstractHandlerTest\\:\\:\\$key2 has no type specified\\.$#',
11211-
'count' => 1,
11212-
'path' => __DIR__ . '/tests/system/Cache/Handlers/AbstractHandlerTest.php',
11213-
];
11214-
$ignoreErrors[] = [
11215-
'message' => '#^Property CodeIgniter\\\\Cache\\\\Handlers\\\\AbstractHandlerTest\\:\\:\\$key3 has no type specified\\.$#',
11216-
'count' => 1,
11217-
'path' => __DIR__ . '/tests/system/Cache/Handlers/AbstractHandlerTest.php',
11218-
];
1121911199
$ignoreErrors[] = [
1122011200
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\BaseHandlerTest\\:\\:provideValidateKeyInvalidType\\(\\) return type has no value type specified in iterable type iterable\\.$#',
1122111201
'count' => 1,
@@ -12461,31 +12441,6 @@
1246112441
'count' => 1,
1246212442
'path' => __DIR__ . '/tests/system/Database/DatabaseTestCaseTest.php',
1246312443
];
12464-
$ignoreErrors[] = [
12465-
'message' => '#^Method CodeIgniter\\\\Database\\\\Live\\\\AbstractGetFieldDataTest\\:\\:assertSameFieldData\\(\\) has no return type specified\\.$#',
12466-
'count' => 1,
12467-
'path' => __DIR__ . '/tests/system/Database/Live/AbstractGetFieldDataTest.php',
12468-
];
12469-
$ignoreErrors[] = [
12470-
'message' => '#^Method CodeIgniter\\\\Database\\\\Live\\\\AbstractGetFieldDataTest\\:\\:assertSameFieldData\\(\\) has parameter \\$actual with no value type specified in iterable type array\\.$#',
12471-
'count' => 1,
12472-
'path' => __DIR__ . '/tests/system/Database/Live/AbstractGetFieldDataTest.php',
12473-
];
12474-
$ignoreErrors[] = [
12475-
'message' => '#^Method CodeIgniter\\\\Database\\\\Live\\\\AbstractGetFieldDataTest\\:\\:assertSameFieldData\\(\\) has parameter \\$expected with no value type specified in iterable type array\\.$#',
12476-
'count' => 1,
12477-
'path' => __DIR__ . '/tests/system/Database/Live/AbstractGetFieldDataTest.php',
12478-
];
12479-
$ignoreErrors[] = [
12480-
'message' => '#^Method CodeIgniter\\\\Database\\\\Live\\\\AbstractGetFieldDataTest\\:\\:createTableForDefault\\(\\) has no return type specified\\.$#',
12481-
'count' => 1,
12482-
'path' => __DIR__ . '/tests/system/Database/Live/AbstractGetFieldDataTest.php',
12483-
];
12484-
$ignoreErrors[] = [
12485-
'message' => '#^Method CodeIgniter\\\\Database\\\\Live\\\\AbstractGetFieldDataTest\\:\\:createTableForType\\(\\) has no return type specified\\.$#',
12486-
'count' => 1,
12487-
'path' => __DIR__ . '/tests/system/Database/Live/AbstractGetFieldDataTest.php',
12488-
];
1248912444
$ignoreErrors[] = [
1249012445
'message' => '#^Property CodeIgniter\\\\Database\\\\Live\\\\ConnectTest\\:\\:\\$group1 has no type specified\\.$#',
1249112446
'count' => 1,
@@ -12656,11 +12611,6 @@
1265612611
'count' => 1,
1265712612
'path' => __DIR__ . '/tests/system/Database/Live/SQLite3/AlterTableTest.php',
1265812613
];
12659-
$ignoreErrors[] = [
12660-
'message' => '#^Method CodeIgniter\\\\Database\\\\Live\\\\SQLite3\\\\GetFieldDataTest\\:\\:createTableCompositePrimaryKey\\(\\) has no return type specified\\.$#',
12661-
'count' => 1,
12662-
'path' => __DIR__ . '/tests/system/Database/Live/SQLite3/GetFieldDataTest.php',
12663-
];
1266412614
$ignoreErrors[] = [
1266512615
'message' => '#^PHPDoc type CodeIgniter\\\\Database\\\\SQLite3\\\\Connection of property CodeIgniter\\\\Database\\\\Live\\\\SQLite3\\\\GetIndexDataTest\\:\\:\\$db is not the same as PHPDoc type CodeIgniter\\\\Database\\\\BaseConnection of overridden property CodeIgniter\\\\Test\\\\CIUnitTestCase\\:\\:\\$db\\.$#',
1266612616
'count' => 1,
@@ -13071,11 +13021,6 @@
1307113021
'count' => 1,
1307213022
'path' => __DIR__ . '/tests/system/Events/EventsTest.php',
1307313023
];
13074-
$ignoreErrors[] = [
13075-
'message' => '#^Property class@anonymous/tests/system/Events/EventsTest\\.php\\:285\\:\\:\\$logged has no type specified\\.$#',
13076-
'count' => 1,
13077-
'path' => __DIR__ . '/tests/system/Events/EventsTest.php',
13078-
];
1307913024
$ignoreErrors[] = [
1308013025
'message' => '#^Property CodeIgniter\\\\Filters\\\\CSRFTest\\:\\:\\$response \\(CodeIgniter\\\\HTTP\\\\Response\\|null\\) does not accept CodeIgniter\\\\HTTP\\\\ResponseInterface\\.$#',
1308113026
'count' => 2,

0 commit comments

Comments
 (0)