Skip to content

Commit 6b14f69

Browse files
authored
Merge pull request reactphp#450 from clue-labs/phpunit
Update test suite to support PHPUnit 9
2 parents a8b9f19 + 67f301d commit 6b14f69

File tree

5 files changed

+43
-13
lines changed

5 files changed

+43
-13
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/.github/ export-ignore
33
/.gitignore export-ignore
44
/phpunit.xml.dist export-ignore
5-
/tests export-ignore
5+
/phpunit.xml.legacy export-ignore
6+
/tests/ export-ignore

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
coverage: xdebug
2929
- run: composer install
3030
- run: vendor/bin/phpunit --coverage-text --exclude-group internet
31+
if: ${{ matrix.php >= 7.3 }}
32+
- run: vendor/bin/phpunit --coverage-text --exclude-group internet -c phpunit.xml.legacy
33+
if: ${{ matrix.php < 7.3 }}
3134

3235
PHPUnit-hhvm:
3336
name: PHPUnit (HHVM)
@@ -38,5 +41,5 @@ jobs:
3841
- uses: azjezz/setup-hhvm@v1
3942
with:
4043
version: lts-3.30
41-
- run: hhvm $(which composer) require phpunit/phpunit:^5 --dev # requires legacy phpunit
44+
- run: hhvm $(which composer) install
4245
- run: hhvm vendor/bin/phpunit --exclude-group internet

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
},
1010
"require": {
1111
"php": ">=5.3.8",
12-
"react/cache": "^1.0",
12+
"react/cache": "^1.1",
1313
"react/dns": "^1.8",
1414
"react/event-loop": "^1.2",
1515
"react/http": "^1.6",
16-
"react/promise": "^2.1 || ^1.2",
17-
"react/promise-stream": "^1.1.1",
16+
"react/promise": "^2.8 || ^1.2",
17+
"react/promise-stream": "^1.3",
1818
"react/promise-timer": "^1.7",
1919
"react/socket": "^1.9",
2020
"react/stream": "^1.2"
2121
},
2222
"require-dev": {
23-
"clue/block-react": "^1.1",
23+
"clue/block-react": "^1.5",
2424
"clue/stream-filter": "^1.3",
25-
"phpunit/phpunit": "^7.0 || ^6.0 || ^5.7 || ^4.8.35"
25+
"phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35"
2626
},
2727
"config": {
2828
"preferred-install": {

phpunit.xml.dist

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit bootstrap="tests/bootstrap.php" colors="true">
3+
<!-- PHPUnit configuration file with new format for PHPUnit 9.5+ -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
6+
bootstrap="tests/bootstrap.php"
7+
cacheResult="false"
8+
colors="true">
49
<testsuites>
510
<testsuite name="ReactPHP Test Suite">
611
<directory>./vendor/react/*/tests/</directory>
@@ -10,10 +15,9 @@
1015
<exclude>./vendor/react/http/tests/HttpServerTest.php</exclude>
1116
</testsuite>
1217
</testsuites>
13-
14-
<filter>
15-
<whitelist>
18+
<coverage>
19+
<include>
1620
<directory>./vendor/react/*/src/</directory>
17-
</whitelist>
18-
</filter>
21+
</include>
22+
</coverage>
1923
</phpunit>

phpunit.xml.legacy

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- PHPUnit configuration file with old PHPUnit format for PHP < 7.3 -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
6+
bootstrap="tests/bootstrap.php"
7+
colors="true">
8+
<testsuites>
9+
<testsuite name="ReactPHP Test Suite">
10+
<directory>./vendor/react/*/tests/</directory>
11+
<!-- temporarily skip broken und unneeded tests, see https://github.com/reactphp/event-loop/pull/232 -->
12+
<exclude>./vendor/react/event-loop/tests/BinTest.php</exclude>
13+
<!-- temporarily skip broken und unneeded tests, see https://github.com/reactphp/http/pull/440 -->
14+
<exclude>./vendor/react/http/tests/HttpServerTest.php</exclude>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory>./vendor/react/*/src/</directory>
20+
</whitelist>
21+
</filter>
22+
</phpunit>

0 commit comments

Comments
 (0)