diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 274d2455..8021ad94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,10 +7,11 @@ on: jobs: PHPUnit: name: PHPUnit (PHP ${{ matrix.php }}) - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 strategy: matrix: php: + - 8.6 - 8.5 - 8.4 - 8.3 @@ -22,7 +23,7 @@ jobs: - 7.2 - 7.1 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} diff --git a/composer.json b/composer.json index 1f05ff9a..96a12182 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,8 @@ "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "fig/http-message-util": "^1.1", "psr/http-message": "^2.0 || ^1.0", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.3 || ^1.2.1", + "react/event-loop": "^1.6", + "react/promise": "^3.3 || ^2.3 || ^1.2.1", "react/socket": "^1.16", "react/stream": "^1.4" }, diff --git a/tests/FunctionalHttpServerTest.php b/tests/FunctionalHttpServerTest.php index dc0bd276..a146067c 100644 --- a/tests/FunctionalHttpServerTest.php +++ b/tests/FunctionalHttpServerTest.php @@ -142,6 +142,16 @@ public function testSecureHttpsOnRandomPort() ]]); $http->listen($socket); + // clear OpenSSL errors from closing the server side before the client reads, + // as legacy PHP < 7.2 does not (https://bugs.php.net/bug.php?id=78775) + $socket->on('connection', function (ConnectionInterface $conn) { + $conn->on('close', function () { + Loop::futureTick(function () { + while (openssl_error_string() !== false); + }); + }); + }); + $result = $connector->connect($socket->getAddress())->then(function (ConnectionInterface $conn) { $conn->write("GET / HTTP/1.0\r\nHost: " . noScheme($conn->getRemoteAddress()) . "\r\n\r\n"); @@ -169,6 +179,16 @@ public function testSecureHttpsReturnsData() $socket = new SocketServer('tls://127.0.0.1:0', ['tls' => ['local_cert' => __DIR__ . '/../examples/localhost.pem']]); $http->listen($socket); + // clear OpenSSL errors from closing the server side before the client reads, + // as legacy PHP < 7.2 does not (https://bugs.php.net/bug.php?id=78775) + $socket->on('connection', function (ConnectionInterface $conn) { + $conn->on('close', function () { + Loop::futureTick(function () { + while (openssl_error_string() !== false); + }); + }); + }); + $connector = new Connector(['tls' => [ 'verify_peer' => false ]]); @@ -203,6 +223,16 @@ public function testSecureHttpsOnRandomPortWithoutHostHeaderUsesSocketUri() ]]); $http->listen($socket); + // clear OpenSSL errors from closing the server side before the client reads, + // as legacy PHP < 7.2 does not (https://bugs.php.net/bug.php?id=78775) + $socket->on('connection', function (ConnectionInterface $conn) { + $conn->on('close', function () { + Loop::futureTick(function () { + while (openssl_error_string() !== false); + }); + }); + }); + $result = $connector->connect($socket->getAddress())->then(function (ConnectionInterface $conn) { $conn->write("GET / HTTP/1.0\r\n\r\n"); diff --git a/tests/Io/AbstractMessageTest.php b/tests/Io/AbstractMessageTest.php index 5451281a..5a961352 100644 --- a/tests/Io/AbstractMessageTest.php +++ b/tests/Io/AbstractMessageTest.php @@ -15,7 +15,7 @@ class MessageMock extends AbstractMessage */ public function __construct($protocolVersion, array $headers, StreamInterface $body) { - return parent::__construct($protocolVersion, $headers, $body); + parent::__construct($protocolVersion, $headers, $body); } }