Skip to content

Commit 3007e4d

Browse files
Upgrade PHPUnit and add PHP 8.4 to CI
1 parent a884fb2 commit 3007e4d

File tree

4 files changed

+52
-16
lines changed

4 files changed

+52
-16
lines changed

.github/workflows/test-application.yaml

+15-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ jobs:
2222
- php-version: '7.2'
2323
dependency-versions: 'lowest'
2424
tools: 'composer:v2'
25+
phpunit-config: 'phpunit-9.xml.dist'
2526
env:
2627
SYMFONY_DEPRECATIONS_HELPER: disabled
2728

2829
- php-version: '7.4'
2930
dependency-versions: 'highest'
3031
tools: 'composer:v2'
32+
phpunit-config: 'phpunit-9.xml.dist'
3133
env:
3234
SYMFONY_DEPRECATIONS_HELPER: disabled
3335

@@ -55,6 +57,13 @@ jobs:
5557
env:
5658
SYMFONY_DEPRECATIONS_HELPER: weak
5759

60+
- php-version: '8.4'
61+
dependency-versions: 'highest'
62+
tools: 'composer:v2'
63+
composer-options: '--ignore-platform-reqs'
64+
env:
65+
SYMFONY_DEPRECATIONS_HELPER: weak
66+
5867
services:
5968
mysql:
6069
image: mysql:5.7
@@ -79,20 +88,23 @@ jobs:
7988
if: ${{ matrix.php-version == '7.2' }}
8089
run: composer remove phpspec/prophecy-phpunit --no-update --dev
8190

82-
- name: Remove not required test tooling
83-
run: composer remove "*php-cs-fixer*" "*phpstan*" --no-update --dev
91+
- name: Remove Lint Tools
92+
# These tools are not required to run tests, so we are removing them to improve dependency resolving and
93+
# testing lowest versions.
94+
run: composer remove "*php-cs-fixer*" "*phpstan*" "*rector*" --dev --no-update
8495

8596
- name: Install composer dependencies
8697
uses: ramsey/composer-install@v2
8798
with:
8899
dependency-versions: ${{matrix.dependency-versions}}
100+
composer-options: ${{ matrix.composer-options }}
89101

90102
- name: Bootstrap test environment
91103
run: composer bootstrap-test-environment
92104
env: ${{ matrix.env }}
93105

94106
- name: Execute test cases
95-
run: composer test
107+
run: composer test -- --config ${{ matrix.phpunit-config || 'phpunit.xml.dist' }}
96108
env: ${{ matrix.env }}
97109

98110
lint:

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"phpstan/phpstan-doctrine": "^1.0",
2828
"phpstan/phpstan-phpunit": "^1.0",
2929
"phpstan/phpstan-symfony": "^1.0",
30-
"phpunit/phpunit": "^8.0 ||^9.6",
30+
"phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.0",
3131
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.0 || ^7.0",
3232
"symfony/dotenv": "^4.4 || ^5.4 || ^6.0 || ^7.0",
3333
"symfony/form": "^4.4 || ^5.4 || ^6.0 || ^7.0",

phpunit-9.xml.dist

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit colors="true" bootstrap="Tests/bootstrap.php">
3+
<testsuites>
4+
<testsuite name="Sulu Comment Bundle">
5+
<directory>./Tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
9+
<filter>
10+
<whitelist addUncoveredFilesFromWhitelist="true">
11+
<directory>.</directory>
12+
<exclude>
13+
<directory>Resources/</directory>
14+
<directory>Tests/</directory>
15+
<directory>vendor/</directory>
16+
</exclude>
17+
</whitelist>
18+
</filter>
19+
20+
<php>
21+
<env name="KERNEL_CLASS" value="Sulu\Bundle\CommentBundle\Tests\Application\Kernel"/>
22+
<env name="APP_ENV" value="test" force="true"/>
23+
</php>
24+
</phpunit>

phpunit.xml.dist

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit colors="true" bootstrap="Tests/bootstrap.php">
3-
<testsuites>
3+
<testsuites>
44
<testsuite name="Sulu Comment Bundle">
55
<directory>./Tests</directory>
66
</testsuite>
77
</testsuites>
88

9-
<filter>
10-
<whitelist addUncoveredFilesFromWhitelist="true">
11-
<directory>.</directory>
12-
<exclude>
13-
<directory>Resources/</directory>
14-
<directory>Tests/</directory>
15-
<directory>vendor/</directory>
16-
</exclude>
17-
</whitelist>
18-
</filter>
19-
209
<php>
2110
<env name="KERNEL_CLASS" value="Sulu\Bundle\CommentBundle\Tests\Application\Kernel"/>
2211
</php>
12+
13+
<source>
14+
<include>
15+
<directory>./</directory>
16+
</include>
17+
<exclude>
18+
<directory>Resources/</directory>
19+
<directory>Tests/</directory>
20+
<directory>vendor/</directory>
21+
</exclude>
22+
</source>
2323
</phpunit>

0 commit comments

Comments
 (0)