Skip to content

Commit 1fd5c9b

Browse files
committed
test: phpunit config file per php version
1 parent c35b0ac commit 1fd5c9b

File tree

5 files changed

+83
-8
lines changed

5 files changed

+83
-8
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: vendor/bin/phpstan analyze
4343

4444
- name: PHPUnit
45-
run: vendor/bin/phpunit --coverage-clover coverage.xml
45+
run: vendor/bin/phpunit --coverage-clover coverage.xml --configuration phpunit.php${{ matrix.php_version }}.xml.dist
4646

4747
- name: Coverage
4848
run: bash <(curl -s https://codecov.io/bash)

phpunit.php8.0.xml.dist

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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/10.0/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
executionOrder="depends,defects"
6+
convertDeprecationsToExceptions="true"
7+
failOnRisky="true"
8+
failOnWarning="true"
9+
verbose="true">
10+
<testsuites>
11+
<testsuite name="Unit">
12+
<directory>tests/Unit</directory>
13+
</testsuite>
14+
<testsuite name="Feature">
15+
<directory>tests/Feature</directory>
16+
</testsuite>
17+
</testsuites>
18+
19+
<coverage>
20+
<include>
21+
<directory suffix=".php">src</directory>
22+
</include>
23+
</coverage>
24+
25+
<php>
26+
<env name="DB_CONNECTION" value="sqlite" />
27+
<env name="DB_DATABASE" value=":memory:" />
28+
</php>
29+
</phpunit>

phpunit.php8.1.xml.dist

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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/10.0/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
executionOrder="depends,defects"
6+
failOnRisky="true"
7+
failOnWarning="true">
8+
<testsuites>
9+
<testsuite name="Unit">
10+
<directory>tests/Unit</directory>
11+
</testsuite>
12+
<testsuite name="Feature">
13+
<directory>tests/Feature</directory>
14+
</testsuite>
15+
</testsuites>
16+
<coverage>
17+
<include>
18+
<directory suffix=".php">src</directory>
19+
</include>
20+
</coverage>
21+
<php>
22+
<env name="DB_CONNECTION" value="sqlite"/>
23+
<env name="DB_DATABASE" value=":memory:"/>
24+
</php>
25+
</phpunit>

phpunit.php8.2.xml.dist

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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/10.0/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
executionOrder="depends,defects"
6+
failOnRisky="true"
7+
failOnWarning="true">
8+
<testsuites>
9+
<testsuite name="Unit">
10+
<directory>tests/Unit</directory>
11+
</testsuite>
12+
<testsuite name="Feature">
13+
<directory>tests/Feature</directory>
14+
</testsuite>
15+
</testsuites>
16+
<coverage>
17+
<include>
18+
<directory suffix=".php">src</directory>
19+
</include>
20+
</coverage>
21+
<php>
22+
<env name="DB_CONNECTION" value="sqlite"/>
23+
<env name="DB_DATABASE" value=":memory:"/>
24+
</php>
25+
</phpunit>

phpunit.xml.dist

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
executionOrder="depends,defects"
6-
convertDeprecationsToExceptions="true"
76
failOnRisky="true"
8-
failOnWarning="true"
9-
verbose="true">
7+
failOnWarning="true">
108
<testsuites>
119
<testsuite name="Unit">
1210
<directory>tests/Unit</directory>
@@ -15,15 +13,13 @@
1513
<directory>tests/Feature</directory>
1614
</testsuite>
1715
</testsuites>
18-
1916
<coverage>
2017
<include>
2118
<directory suffix=".php">src</directory>
2219
</include>
2320
</coverage>
24-
2521
<php>
26-
<env name="DB_CONNECTION" value="sqlite" />
27-
<env name="DB_DATABASE" value=":memory:" />
22+
<env name="DB_CONNECTION" value="sqlite"/>
23+
<env name="DB_DATABASE" value=":memory:"/>
2824
</php>
2925
</phpunit>

0 commit comments

Comments
 (0)