Skip to content

Commit

Permalink
Upgrade PHPUnit and add PHP 8.4 to CI (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 24, 2024
1 parent c36a698 commit 5f542f1
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 22 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ jobs:
include:
- php-version: '7.3'
dependency-versions: 'lowest'
phpunit-config: 'phpunit-9.xml.dist'
env:
SYMFONY_DEPRECATIONS_HELPER: disabled

- php-version: '7.4'
dependency-versions: 'highest'
phpunit-config: 'phpunit-9.xml.dist'
env:
SYMFONY_DEPRECATIONS_HELPER: weak

Expand All @@ -51,6 +53,12 @@ jobs:
env:
SYMFONY_DEPRECATIONS_HELPER: weak

- php-version: '8.4'
dependency-versions: 'highest'
composer-options: '--ignore-platform-reqs'
env:
SYMFONY_DEPRECATIONS_HELPER: weak

services:
mysql:
image: mysql:5.7
Expand Down Expand Up @@ -79,13 +87,14 @@ jobs:
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{matrix.dependency-versions}}
composer-options: ${{ matrix.composer-options }}

- name: Bootstrap test environment
run: composer bootstrap-test-environment
env: ${{ matrix.env }}

- name: Execute test cases
run: time composer test
run: time composer test -- --config ${{ matrix.phpunit-config || 'phpunit.xml.dist' }}
env: ${{ matrix.env }}

lint:
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
"phpstan/phpstan-doctrine": "^1.2",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.1",
"phpunit/phpunit": "^8.5.9 || ^9.5",
"phpunit/phpunit": "^9.6 || ^10.0",
"symfony/dotenv": "^5.4 || ^6.0 || ^7.0",
"symfony/monolog-bundle": "^3.1",
"symfony/phpunit-bridge": "^5.2 || ^6.0 || ^7.0",
"thecodingmachine/phpstan-strict-rules": "^1.0"
},
"conflict": {
Expand Down
24 changes: 24 additions & 0 deletions phpunit-9.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="Tests/test-bootstrap.php" colors="true">

<testsuites>
<testsuite name="SuluThemeBundle Test Suite">
<directory suffix="Test.php">./Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>

<php>
<env name="KERNEL_CLASS" value="Sulu\Bundle\ThemeBundle\Tests\Application\Kernel"/>
<env name="APP_ENV" value="test" force="true"/>
</php>
</phpunit>
33 changes: 14 additions & 19 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="Tests/test-bootstrap.php" colors="true">

<testsuites>
<testsuite name="SuluThemeBundle Test Suite">
<directory suffix="Test.php">./Tests</directory>
<testsuite name="Sulu Theme Bundle">
<directory>./Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>

<php>
<env name="SYMFONY_PHPUNIT_VERSION" value="8.0"/>
<env name="APP_ENV" value="test"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
<env name="KERNEL_CLASS" value="Sulu\Bundle\ThemeBundle\Tests\Application\Kernel"/>
<env name="APP_ENV" value="test" force="true"/>
</php>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
<source>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>Resources/</directory>
<directory>Tests/</directory>
<directory>vendor/</directory>
</exclude>
</source>
</phpunit>

0 comments on commit 5f542f1

Please sign in to comment.