Skip to content

Commit ef76508

Browse files
authored
Merge pull request #130 from kenjis/update-phpunit10
Add support PHPUnit 10
2 parents 7e04dd8 + 06707af commit ef76508

File tree

3 files changed

+175
-101
lines changed

3 files changed

+175
-101
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
"fakerphp/faker": "^1.9",
2828
"mikey179/vfsstream": "^1.6",
2929
"nexusphp/cs-config": "^3.6",
30-
"nexusphp/tachycardia": "^1.3",
30+
"nexusphp/tachycardia": "^1.3 || ^2.0",
3131
"phpstan/extension-installer": "^1.1",
3232
"phpstan/phpstan": "^1.0",
3333
"phpstan/phpstan-deprecation-rules": "^1.0",
3434
"phpstan/phpstan-phpunit": "^1.0",
35-
"phpunit/phpunit": "^9.3",
35+
"phpunit/phpunit": "^9.3 || ^10.5.16",
3636
"rector/rector": "^0.19 || ^1.0.0",
3737
"roave/security-advisories": "dev-latest",
3838
"vimeo/psalm": "^5.0"

src/Template/phpunit.xml.dist

Lines changed: 71 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,74 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
4-
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
5-
backupGlobals="false"
6-
beStrictAboutCoversAnnotation="true"
7-
beStrictAboutOutputDuringTests="true"
8-
beStrictAboutTodoAnnotatedTests="true"
9-
colors="true"
10-
convertErrorsToExceptions="true"
11-
convertNoticesToExceptions="true"
12-
convertWarningsToExceptions="true"
13-
executionOrder="random"
14-
failOnRisky="true"
15-
failOnWarning="true"
16-
stopOnError="false"
17-
stopOnFailure="false"
18-
stopOnIncomplete="false"
19-
stopOnSkipped="false"
20-
verbose="true">
21-
22-
<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
23-
<include>
24-
<directory suffix=".php">./app/</directory>
25-
</include>
26-
<exclude>
27-
<directory suffix=".php">./app/Config</directory>
28-
<directory suffix=".php">./app/Views</directory>
29-
</exclude>
30-
<report>
31-
<clover outputFile="build/phpunit/clover.xml"/>
32-
<html outputDirectory="build/phpunit/html"/>
33-
<php outputFile="build/phpunit/coverage.serialized"/>
34-
<text outputFile="php://stdout" showUncoveredFiles="false"/>
35-
<xml outputDirectory="build/phpunit/xml-coverage"/>
36-
</report>
37-
</coverage>
38-
39-
<testsuites>
40-
<testsuite name="main">
41-
<directory>./tests</directory>
42-
</testsuite>
43-
</testsuites>
44-
45-
<extensions>
46-
<extension class="Nexus\PHPUnit\Extension\Tachycardia">
47-
<arguments>
48-
<array>
49-
<element key="timeLimit">
50-
<double>0.50</double>
51-
</element>
52-
<element key="reportable">
53-
<integer>30</integer>
54-
</element>
55-
<element key="precision">
56-
<integer>2</integer>
57-
</element>
58-
<element key="collectBare">
59-
<boolean>true</boolean>
60-
</element>
61-
<element key="tabulate">
62-
<boolean>true</boolean>
63-
</element>
64-
</array>
65-
</arguments>
66-
</extension>
67-
</extensions>
68-
69-
<logging>
70-
<testdoxHtml outputFile="build/phpunit/testdox.html"/>
71-
<testdoxText outputFile="build/phpunit/testdox.txt"/>
72-
<junit outputFile="build/phpunit/junit.xml"/>
73-
</logging>
74-
75-
<php>
76-
<env name="XDEBUG_MODE" value="coverage"/>
77-
<server name="app.baseURL" value="https://example.com/"/>
78-
79-
<!-- Directory containing phpunit.xml -->
80-
<const name="HOMEPATH" value="./"/>
81-
82-
<!-- Directory containing the Paths config file -->
83-
<const name="CONFIGPATH" value="./app/Config/"/>
84-
85-
<!-- Directory containing the front controller (index.php) -->
86-
<const name="PUBLICPATH" value="./public/"/>
87-
88-
<!-- https://getcomposer.org/xdebug -->
89-
<env name="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
90-
91-
<!-- Database configuration -->
92-
<env name="database.tests.strictOn" value="true"/>
93-
<!-- Uncomment to use alternate testing database configuration
94-
<env name="database.tests.hostname" value="localhost"/>
95-
<env name="database.tests.database" value="tests"/>
96-
<env name="database.tests.username" value="tests_user"/>
97-
<env name="database.tests.password" value=""/>
98-
<env name="database.tests.DBDriver" value="MySQLi"/>
99-
<env name="database.tests.DBPrefix" value="tests_"/>
100-
-->
101-
</php>
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
5+
backupGlobals="false"
6+
beStrictAboutOutputDuringTests="true"
7+
colors="true"
8+
executionOrder="random"
9+
failOnRisky="true"
10+
failOnWarning="true"
11+
stopOnError="false"
12+
stopOnFailure="false"
13+
stopOnIncomplete="false"
14+
stopOnSkipped="false"
15+
cacheDirectory=".phpunit.cache"
16+
beStrictAboutCoverageMetadata="true">
17+
<coverage includeUncoveredFiles="true">
18+
<report>
19+
<clover outputFile="build/phpunit/clover.xml"/>
20+
<html outputDirectory="build/phpunit/html"/>
21+
<php outputFile="build/phpunit/coverage.serialized"/>
22+
<text outputFile="php://stdout" showUncoveredFiles="false"/>
23+
<xml outputDirectory="build/phpunit/xml-coverage"/>
24+
</report>
25+
</coverage>
26+
<testsuites>
27+
<testsuite name="main">
28+
<directory>./tests</directory>
29+
</testsuite>
30+
</testsuites>
31+
<extensions>
32+
<bootstrap class="Nexus\PHPUnit\Tachycardia\TachycardiaExtension">
33+
<parameter name="time-limit" value="0.50"/>
34+
<parameter name="report-count" value="30"/>
35+
<parameter name="format" value="table"/>
36+
</bootstrap>
37+
</extensions>
38+
<logging>
39+
<testdoxHtml outputFile="build/phpunit/testdox.html"/>
40+
<testdoxText outputFile="build/phpunit/testdox.txt"/>
41+
<junit outputFile="build/phpunit/junit.xml"/>
42+
</logging>
43+
<php>
44+
<env name="XDEBUG_MODE" value="coverage"/>
45+
<server name="app.baseURL" value="https://example.com/"/>
46+
<!-- Directory containing phpunit.xml -->
47+
<const name="HOMEPATH" value="./"/>
48+
<!-- Directory containing the Paths config file -->
49+
<const name="CONFIGPATH" value="./app/Config/"/>
50+
<!-- Directory containing the front controller (index.php) -->
51+
<const name="PUBLICPATH" value="./public/"/>
52+
<!-- https://getcomposer.org/xdebug -->
53+
<env name="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
54+
<!-- Database configuration -->
55+
<env name="database.tests.strictOn" value="true"/>
56+
<!-- Uncomment to use alternate testing database configuration
57+
<env name="database.tests.hostname" value="localhost"/>
58+
<env name="database.tests.database" value="tests"/>
59+
<env name="database.tests.username" value="tests_user"/>
60+
<env name="database.tests.password" value=""/>
61+
<env name="database.tests.DBDriver" value="MySQLi"/>
62+
<env name="database.tests.DBPrefix" value="tests_"/>
63+
-->
64+
</php>
65+
<source>
66+
<include>
67+
<directory suffix=".php">./app/</directory>
68+
</include>
69+
<exclude>
70+
<directory suffix=".php">./app/Config</directory>
71+
<directory suffix=".php">./app/Views</directory>
72+
</exclude>
73+
</source>
10274
</phpunit>

src/Template/phpunit9.xml.dist

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
4+
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
5+
backupGlobals="false"
6+
beStrictAboutCoversAnnotation="true"
7+
beStrictAboutOutputDuringTests="true"
8+
beStrictAboutTodoAnnotatedTests="true"
9+
colors="true"
10+
convertErrorsToExceptions="true"
11+
convertNoticesToExceptions="true"
12+
convertWarningsToExceptions="true"
13+
executionOrder="random"
14+
failOnRisky="true"
15+
failOnWarning="true"
16+
stopOnError="false"
17+
stopOnFailure="false"
18+
stopOnIncomplete="false"
19+
stopOnSkipped="false"
20+
verbose="true">
21+
22+
<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
23+
<include>
24+
<directory suffix=".php">./app/</directory>
25+
</include>
26+
<exclude>
27+
<directory suffix=".php">./app/Config</directory>
28+
<directory suffix=".php">./app/Views</directory>
29+
</exclude>
30+
<report>
31+
<clover outputFile="build/phpunit/clover.xml"/>
32+
<html outputDirectory="build/phpunit/html"/>
33+
<php outputFile="build/phpunit/coverage.serialized"/>
34+
<text outputFile="php://stdout" showUncoveredFiles="false"/>
35+
<xml outputDirectory="build/phpunit/xml-coverage"/>
36+
</report>
37+
</coverage>
38+
39+
<testsuites>
40+
<testsuite name="main">
41+
<directory>./tests</directory>
42+
</testsuite>
43+
</testsuites>
44+
45+
<extensions>
46+
<extension class="Nexus\PHPUnit\Extension\Tachycardia">
47+
<arguments>
48+
<array>
49+
<element key="timeLimit">
50+
<double>0.50</double>
51+
</element>
52+
<element key="reportable">
53+
<integer>30</integer>
54+
</element>
55+
<element key="precision">
56+
<integer>2</integer>
57+
</element>
58+
<element key="collectBare">
59+
<boolean>true</boolean>
60+
</element>
61+
<element key="tabulate">
62+
<boolean>true</boolean>
63+
</element>
64+
</array>
65+
</arguments>
66+
</extension>
67+
</extensions>
68+
69+
<logging>
70+
<testdoxHtml outputFile="build/phpunit/testdox.html"/>
71+
<testdoxText outputFile="build/phpunit/testdox.txt"/>
72+
<junit outputFile="build/phpunit/junit.xml"/>
73+
</logging>
74+
75+
<php>
76+
<env name="XDEBUG_MODE" value="coverage"/>
77+
<server name="app.baseURL" value="https://example.com/"/>
78+
79+
<!-- Directory containing phpunit.xml -->
80+
<const name="HOMEPATH" value="./"/>
81+
82+
<!-- Directory containing the Paths config file -->
83+
<const name="CONFIGPATH" value="./app/Config/"/>
84+
85+
<!-- Directory containing the front controller (index.php) -->
86+
<const name="PUBLICPATH" value="./public/"/>
87+
88+
<!-- https://getcomposer.org/xdebug -->
89+
<env name="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
90+
91+
<!-- Database configuration -->
92+
<env name="database.tests.strictOn" value="true"/>
93+
<!-- Uncomment to use alternate testing database configuration
94+
<env name="database.tests.hostname" value="localhost"/>
95+
<env name="database.tests.database" value="tests"/>
96+
<env name="database.tests.username" value="tests_user"/>
97+
<env name="database.tests.password" value=""/>
98+
<env name="database.tests.DBDriver" value="MySQLi"/>
99+
<env name="database.tests.DBPrefix" value="tests_"/>
100+
-->
101+
</php>
102+
</phpunit>

0 commit comments

Comments
 (0)