Skip to content

Commit

Permalink
Fix PHPUnit configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
bupy7 committed Dec 29, 2023
1 parent f21a847 commit 1f33762
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 12 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ jobs:
- 8.1
- 8.2
- 8.3
include:
- phpunit: phpunit.xml
- php: 5.6
phpunit: phpunit.legacy.xml
- php: 7.0
phpunit: phpunit.legacy.xml
- php: 7.1
phpunit: phpunit.legacy.xml
- php: 7.2
phpunit: phpunit.legacy.xml
- php: 7.3
phpunit: phpunit.legacy.xml
- php: 7.4
phpunit: phpunit.legacy.xml

steps:
- uses: actions/checkout@v2

Expand All @@ -48,7 +63,7 @@ jobs:
run: composer install --no-plugins

- name: Run test suite
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration ${{ matrix.include.phpunit }}

- name: Upload coverage results to Coveralls
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
/composer.lock
/docker-compose.yml
/.phpunit.result.cache
/.phpunit.cache
/.php-cs-fixer.cache
23 changes: 23 additions & 0 deletions phpunit.legacy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="./tests/bootstrap.php"
verbose="true"
colors="true">

<testsuites>
<testsuite name="Main Tests">
<directory>./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>

<logging>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
28 changes: 17 additions & 11 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./tests/bootstrap.php"
verbose="true"
colors="true">
colors="true"
cacheDirectory=".phpunit.cache"
>
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
</report>
</coverage>

<testsuites>
<testsuite name="Main Tests">
<directory>./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging />

<logging>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>

0 comments on commit 1f33762

Please sign in to comment.