Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test suite to support PHPUnit 9 #450

Merged
merged 1 commit into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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>