Skip to content

Commit 5f542f1

Browse files
Upgrade PHPUnit and add PHP 8.4 to CI (#36)
1 parent c36a698 commit 5f542f1

File tree

4 files changed

+49
-22
lines changed

4 files changed

+49
-22
lines changed

.github/workflows/test-application.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ jobs:
2323
include:
2424
- php-version: '7.3'
2525
dependency-versions: 'lowest'
26+
phpunit-config: 'phpunit-9.xml.dist'
2627
env:
2728
SYMFONY_DEPRECATIONS_HELPER: disabled
2829

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

@@ -51,6 +53,12 @@ jobs:
5153
env:
5254
SYMFONY_DEPRECATIONS_HELPER: weak
5355

56+
- php-version: '8.4'
57+
dependency-versions: 'highest'
58+
composer-options: '--ignore-platform-reqs'
59+
env:
60+
SYMFONY_DEPRECATIONS_HELPER: weak
61+
5462
services:
5563
mysql:
5664
image: mysql:5.7
@@ -79,13 +87,14 @@ jobs:
7987
uses: ramsey/composer-install@v2
8088
with:
8189
dependency-versions: ${{matrix.dependency-versions}}
90+
composer-options: ${{ matrix.composer-options }}
8291

8392
- name: Bootstrap test environment
8493
run: composer bootstrap-test-environment
8594
env: ${{ matrix.env }}
8695

8796
- name: Execute test cases
88-
run: time composer test
97+
run: time composer test -- --config ${{ matrix.phpunit-config || 'phpunit.xml.dist' }}
8998
env: ${{ matrix.env }}
9099

91100
lint:

composer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131
"phpstan/phpstan-doctrine": "^1.2",
3232
"phpstan/phpstan-phpunit": "^1.0",
3333
"phpstan/phpstan-symfony": "^1.1",
34-
"phpunit/phpunit": "^8.5.9 || ^9.5",
34+
"phpunit/phpunit": "^9.6 || ^10.0",
3535
"symfony/dotenv": "^5.4 || ^6.0 || ^7.0",
3636
"symfony/monolog-bundle": "^3.1",
37-
"symfony/phpunit-bridge": "^5.2 || ^6.0 || ^7.0",
3837
"thecodingmachine/phpstan-strict-rules": "^1.0"
3938
},
4039
"conflict": {

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 bootstrap="Tests/test-bootstrap.php" colors="true">
3+
4+
<testsuites>
5+
<testsuite name="SuluThemeBundle Test Suite">
6+
<directory suffix="Test.php">./Tests</directory>
7+
</testsuite>
8+
</testsuites>
9+
10+
<filter>
11+
<whitelist>
12+
<directory>./</directory>
13+
<exclude>
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\ThemeBundle\Tests\Application\Kernel"/>
22+
<env name="APP_ENV" value="test" force="true"/>
23+
</php>
24+
</phpunit>

phpunit.xml.dist

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit bootstrap="Tests/test-bootstrap.php" colors="true">
3-
43
<testsuites>
5-
<testsuite name="SuluThemeBundle Test Suite">
6-
<directory suffix="Test.php">./Tests</directory>
4+
<testsuite name="Sulu Theme Bundle">
5+
<directory>./Tests</directory>
76
</testsuite>
87
</testsuites>
98

10-
<filter>
11-
<whitelist>
12-
<directory>./</directory>
13-
<exclude>
14-
<directory>./Tests</directory>
15-
<directory>./vendor</directory>
16-
</exclude>
17-
</whitelist>
18-
</filter>
19-
209
<php>
21-
<env name="SYMFONY_PHPUNIT_VERSION" value="8.0"/>
22-
<env name="APP_ENV" value="test"/>
23-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
10+
<env name="KERNEL_CLASS" value="Sulu\Bundle\ThemeBundle\Tests\Application\Kernel"/>
11+
<env name="APP_ENV" value="test" force="true"/>
2412
</php>
2513

26-
<listeners>
27-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
28-
</listeners>
14+
<source>
15+
<include>
16+
<directory>./</directory>
17+
</include>
18+
<exclude>
19+
<directory>Resources/</directory>
20+
<directory>Tests/</directory>
21+
<directory>vendor/</directory>
22+
</exclude>
23+
</source>
2924
</phpunit>

0 commit comments

Comments
 (0)