Skip to content

Commit

Permalink
PHPUnit 9 fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 24, 2024
1 parent d65e223 commit fd37a76
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ jobs:
coverage: false
dependency-versions: 'lowest'
tools: 'composer:v2'
phpunit-config: 'phpunit-9.xml.dist'
env:
SYMFONY_DEPRECATIONS_HELPER: disabled

- php-version: '7.4'
coverage: true
dependency-versions: 'highest'
tools: 'composer:v2'
phpunit-config: 'phpunit-9.xml.dist'
env:
SYMFONY_DEPRECATIONS_HELPER: weak

Expand Down Expand Up @@ -108,10 +110,10 @@ jobs:
run: composer bootstrap-test-environment

- name: Execute unit test cases
run: composer test -- Tests/Unit --coverage-php var/coverage.php --coverage-html coverage-report --log-junit var/junit.xml
run: composer test -- Tests/Unit --coverage-php var/coverage.php --coverage-html coverage-report --log-junit var/junit.xml --config ${{ matrix.phpunit-config || 'phpunit.xml.dist' }}

- name: Execute functional test cases
run: composer test -- Tests/Functional --log-junit var/junit.xml
run: composer test -- Tests/Functional --log-junit var/junit.xml --config ${{ matrix.phpunit-config || 'phpunit.xml.dist' }}

- name: Check code coverage
if: ${{ matrix.coverage }}
Expand Down
21 changes: 21 additions & 0 deletions phpunit-9.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="Tests/test-bootstrap.php">
<testsuites>
<testsuite name="Sulu Headless Bundle">
<directory>Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory>.</directory>
<exclude>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>

<php>
<env name="KERNEL_CLASS" value="Sulu\Bundle\HeadlessBundle\Tests\Application\Kernel"/>
</php>
</phpunit>
23 changes: 13 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
<phpunit colors="true" bootstrap="Tests/test-bootstrap.php">
<testsuites>
<testsuite name="Sulu Headless Bundle">
<directory>Tests</directory>
<directory>./Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory>.</directory>
<exclude>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>

<php>
<env name="KERNEL_CLASS" value="Sulu\Bundle\HeadlessBundle\Tests\Application\Kernel"/>
<env name="APP_ENV" value="test" force="true"/>
</php>

<source>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>Resources/</directory>
<directory>Tests/</directory>
<directory>vendor/</directory>
</exclude>
</source>
</phpunit>

0 comments on commit fd37a76

Please sign in to comment.