Skip to content

Commit

Permalink
Update test suite to support PHPUnit 9
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Feb 4, 2022
1 parent db19ce4 commit 67f301d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Expand Up @@ -2,4 +2,5 @@
/.github/ export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/phpunit.xml.legacy export-ignore
/tests/ export-ignore
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -28,6 +28,9 @@ jobs:
coverage: xdebug
- run: composer install
- run: vendor/bin/phpunit --coverage-text --exclude-group internet
if: ${{ matrix.php >= 7.3 }}
- run: vendor/bin/phpunit --coverage-text --exclude-group internet -c phpunit.xml.legacy
if: ${{ matrix.php < 7.3 }}

PHPUnit-hhvm:
name: PHPUnit (HHVM)
Expand All @@ -38,5 +41,5 @@ jobs:
- uses: azjezz/setup-hhvm@v1
with:
version: lts-3.30
- run: hhvm $(which composer) require phpunit/phpunit:^5 --dev # requires legacy phpunit
- run: hhvm $(which composer) install
- run: hhvm vendor/bin/phpunit --exclude-group internet
10 changes: 5 additions & 5 deletions composer.json
Expand Up @@ -9,20 +9,20 @@
},
"require": {
"php": ">=5.3.8",
"react/cache": "^1.0",
"react/cache": "^1.1",
"react/dns": "^1.8",
"react/event-loop": "^1.2",
"react/http": "^1.6",
"react/promise": "^2.1 || ^1.2",
"react/promise-stream": "^1.1.1",
"react/promise": "^2.8 || ^1.2",
"react/promise-stream": "^1.3",
"react/promise-timer": "^1.7",
"react/socket": "^1.9",
"react/stream": "^1.2"
},
"require-dev": {
"clue/block-react": "^1.1",
"clue/block-react": "^1.5",
"clue/stream-filter": "^1.3",
"phpunit/phpunit": "^7.0 || ^6.0 || ^5.7 || ^4.8.35"
"phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35"
},
"config": {
"preferred-install": {
Expand Down
16 changes: 10 additions & 6 deletions phpunit.xml.dist
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="tests/bootstrap.php" colors="true">
<!-- PHPUnit configuration file with new format for PHPUnit 9.5+ -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="tests/bootstrap.php"
cacheResult="false"
colors="true">
<testsuites>
<testsuite name="ReactPHP Test Suite">
<directory>./vendor/react/*/tests/</directory>
Expand All @@ -10,10 +15,9 @@
<exclude>./vendor/react/http/tests/HttpServerTest.php</exclude>
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>./vendor/react/*/src/</directory>
</whitelist>
</filter>
</include>
</coverage>
</phpunit>
22 changes: 22 additions & 0 deletions phpunit.xml.legacy
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- PHPUnit configuration file with old PHPUnit format for PHP < 7.3 -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
bootstrap="tests/bootstrap.php"
colors="true">
<testsuites>
<testsuite name="ReactPHP Test Suite">
<directory>./vendor/react/*/tests/</directory>
<!-- temporarily skip broken und unneeded tests, see https://github.com/reactphp/event-loop/pull/232 -->
<exclude>./vendor/react/event-loop/tests/BinTest.php</exclude>
<!-- temporarily skip broken und unneeded tests, see https://github.com/reactphp/http/pull/440 -->
<exclude>./vendor/react/http/tests/HttpServerTest.php</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./vendor/react/*/src/</directory>
</whitelist>
</filter>
</phpunit>

0 comments on commit 67f301d

Please sign in to comment.