Skip to content

Commit 7ee5a33

Browse files
authored
Merge pull request #113 from clue-labs/php8.3-backport
[0.6.x] Run tests on PHP 8.3, update test suite and report failed assertions
2 parents e71eb1a + db8acb9 commit 7ee5a33

File tree

4 files changed

+51
-25
lines changed

4 files changed

+51
-25
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ jobs:
1111
strategy:
1212
matrix:
1313
os:
14-
- ubuntu-20.04
15-
- windows-2019
14+
- ubuntu-24.04
15+
- windows-2022
1616
php:
17+
- 8.3
1718
- 8.2
1819
- 8.1
1920
- 8.0
@@ -27,11 +28,14 @@ jobs:
2728
- 5.4
2829
- 5.3
2930
steps:
30-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v4
3132
- uses: shivammathur/setup-php@v2
3233
with:
3334
php-version: ${{ matrix.php }}
3435
coverage: xdebug
36+
ini-file: development
37+
- run: composer config secure-http false && composer config repo.packagist composer http://packagist.org && composer config preferred-install source
38+
if: ${{ matrix.php < 5.5 && matrix.os == 'windows-2022' }} # legacy PHP on Windows is allowed to use insecure downloads until it will be removed again
3539
- run: composer install
3640
- run: vendor/bin/phpunit --coverage-text
3741
if: ${{ matrix.php >= 7.3 }}
@@ -41,14 +45,20 @@ jobs:
4145

4246
PHPUnit-hhvm:
4347
name: PHPUnit (HHVM)
44-
runs-on: ubuntu-18.04
48+
runs-on: ubuntu-24.04
4549
continue-on-error: true
4650
steps:
47-
- uses: actions/checkout@v2
48-
- uses: azjezz/setup-hhvm@v1
51+
- uses: actions/checkout@v4
52+
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
53+
- name: Run hhvm composer.phar install
54+
uses: docker://hhvm/hhvm:3.30-lts-latest
4955
with:
50-
version: lts-3.30
51-
- run: composer self-update --2.2 # downgrade Composer for HHVM
52-
- run: hhvm $(which composer) install
53-
- run: hhvm vendor/bin/phpunit
54-
- run: hhvm examples/13-benchmark-throughput.php
56+
args: hhvm composer.phar install
57+
- name: Run hhvm vendor/bin/phpunit
58+
uses: docker://hhvm/hhvm:3.30-lts-latest
59+
with:
60+
args: hhvm vendor/bin/phpunit
61+
- name: Run hhvm examples/13-benchmark-throughput.php
62+
uses: docker://hhvm/hhvm:3.30-lts-latest
63+
with:
64+
args: hhvm examples/13-benchmark-throughput.php

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@
3232
"react/stream": "^1.2"
3333
},
3434
"require-dev": {
35-
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35",
35+
"phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",
3636
"react/socket": "^1.8",
3737
"sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0"
3838
},
3939
"autoload": {
40-
"psr-4": { "React\\ChildProcess\\": "src" }
40+
"psr-4": {
41+
"React\\ChildProcess\\": "src/"
42+
}
4143
},
4244
"autoload-dev": {
43-
"psr-4": { "React\\Tests\\ChildProcess\\": "tests" }
45+
"psr-4": {
46+
"React\\Tests\\ChildProcess\\": "tests/"
47+
}
4448
}
4549
}

phpunit.xml.dist

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

3-
<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
4-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
<!-- PHPUnit configuration file with new format for PHPUnit 9.6+ -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
7+
cacheResult="false"
78
colors="true"
8-
cacheResult="false">
9+
convertDeprecationsToExceptions="true">
910
<testsuites>
1011
<testsuite name="React Test Suite">
1112
<directory>./tests/</directory>
@@ -16,4 +17,12 @@
1617
<directory>./src/</directory>
1718
</include>
1819
</coverage>
20+
<php>
21+
<ini name="error_reporting" value="-1" />
22+
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
23+
<!-- <ini name="zend.assertions" value="1" /> -->
24+
<ini name="assert.active" value="1" />
25+
<ini name="assert.exception" value="1" />
26+
<ini name="assert.bail" value="0" />
27+
</php>
1928
</phpunit>

phpunit.xml.legacy

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

3-
<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
3+
<!-- PHPUnit configuration file with old format for legacy PHPUnit -->
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
7-
colors="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
11-
processIsolation="false"
12-
stopOnFailure="false">
7+
colors="true">
138
<testsuites>
149
<testsuite name="React Test Suite">
1510
<directory>./tests/</directory>
@@ -20,4 +15,12 @@
2015
<directory>./src/</directory>
2116
</whitelist>
2217
</filter>
18+
<php>
19+
<ini name="error_reporting" value="-1" />
20+
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
21+
<!-- <ini name="zend.assertions" value="1" /> -->
22+
<ini name="assert.active" value="1" />
23+
<ini name="assert.exception" value="1" />
24+
<ini name="assert.bail" value="0" />
25+
</php>
2326
</phpunit>

0 commit comments

Comments
 (0)