Skip to content

Commit add10bc

Browse files
committed
Run tests on PHP 8.6 and update test environment
1 parent 75cabc6 commit add10bc

4 files changed

Lines changed: 38 additions & 7 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ on:
77
jobs:
88
PHPUnit:
99
name: PHPUnit (PHP ${{ matrix.php }})
10-
runs-on: ubuntu-24.04
10+
runs-on: ubuntu-26.04
1111
strategy:
1212
matrix:
1313
php:
14+
- 8.6
1415
- 8.5
1516
- 8.4
1617
- 8.3
@@ -27,7 +28,7 @@ jobs:
2728
- 5.4
2829
- 5.3
2930
steps:
30-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v7
3132
- uses: shivammathur/setup-php@v2
3233
with:
3334
php-version: ${{ matrix.php }}
@@ -41,10 +42,10 @@ jobs:
4142

4243
PHPUnit-hhvm:
4344
name: PHPUnit (HHVM)
44-
runs-on: ubuntu-22.04
45+
runs-on: ubuntu-26.04
4546
continue-on-error: true
4647
steps:
47-
- uses: actions/checkout@v4
48+
- uses: actions/checkout@v7
4849
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
4950
- name: Run hhvm composer.phar install
5051
uses: docker://hhvm/hhvm:3.30-lts-latest

‎composer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"evenement/evenement": "^3.0 || ^2.0 || ^1.0",
3131
"fig/http-message-util": "^1.1",
3232
"psr/http-message": "^2.0 || ^1.0",
33-
"react/event-loop": "^1.2",
34-
"react/promise": "^3.2 || ^2.3 || ^1.2.1",
33+
"react/event-loop": "^1.6",
34+
"react/promise": "^3.3 || ^2.3 || ^1.2.1",
3535
"react/socket": "^1.16",
3636
"react/stream": "^1.4"
3737
},

‎tests/FunctionalHttpServerTest.php‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ public function testSecureHttpsOnRandomPort()
139139
)));
140140
$http->listen($socket);
141141

142+
// clear OpenSSL errors from closing the server side before the client reads,
143+
// as legacy PHP < 7.2 does not (https://bugs.php.net/bug.php?id=78775)
144+
$socket->on('connection', function (ConnectionInterface $conn) {
145+
$conn->on('close', function () {
146+
Loop::futureTick(function () {
147+
while (openssl_error_string() !== false);
148+
});
149+
});
150+
});
151+
142152
$result = $connector->connect($socket->getAddress())->then(function (ConnectionInterface $conn) {
143153
$conn->write("GET / HTTP/1.0\r\nHost: " . noScheme($conn->getRemoteAddress()) . "\r\n\r\n");
144154

@@ -172,6 +182,16 @@ public function testSecureHttpsReturnsData()
172182
)));
173183
$http->listen($socket);
174184

185+
// clear OpenSSL errors from closing the server side before the client reads,
186+
// as legacy PHP < 7.2 does not (https://bugs.php.net/bug.php?id=78775)
187+
$socket->on('connection', function (ConnectionInterface $conn) {
188+
$conn->on('close', function () {
189+
Loop::futureTick(function () {
190+
while (openssl_error_string() !== false);
191+
});
192+
});
193+
});
194+
175195
$connector = new Connector(array(
176196
'tls' => array('verify_peer' => false)
177197
));
@@ -210,6 +230,16 @@ public function testSecureHttpsOnRandomPortWithoutHostHeaderUsesSocketUri()
210230
)));
211231
$http->listen($socket);
212232

233+
// clear OpenSSL errors from closing the server side before the client reads,
234+
// as legacy PHP < 7.2 does not (https://bugs.php.net/bug.php?id=78775)
235+
$socket->on('connection', function (ConnectionInterface $conn) {
236+
$conn->on('close', function () {
237+
Loop::futureTick(function () {
238+
while (openssl_error_string() !== false);
239+
});
240+
});
241+
});
242+
213243
$result = $connector->connect($socket->getAddress())->then(function (ConnectionInterface $conn) {
214244
$conn->write("GET / HTTP/1.0\r\n\r\n");
215245

‎tests/Io/AbstractMessageTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MessageMock extends AbstractMessage
1515
*/
1616
public function __construct($protocolVersion, array $headers, StreamInterface $body)
1717
{
18-
return parent::__construct($protocolVersion, $headers, $body);
18+
parent::__construct($protocolVersion, $headers, $body);
1919
}
2020
}
2121

0 commit comments

Comments
 (0)