diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efe8870f..f42a7a7f 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 @@ -27,7 +28,7 @@ jobs: - 5.4 - 5.3 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -41,10 +42,10 @@ jobs: PHPUnit-hhvm: name: PHPUnit (HHVM) - runs-on: ubuntu-22.04 + runs-on: ubuntu-26.04 continue-on-error: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM - name: Run hhvm composer.phar install uses: docker://hhvm/hhvm:3.30-lts-latest diff --git a/composer.json b/composer.json index 42a9f83c..a64116f6 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "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/event-loop": "^1.6", "react/promise": "^3.2 || ^2.3 || ^1.2.1", "react/socket": "^1.16", "react/stream": "^1.4" diff --git a/tests/FunctionalHttpServerTest.php b/tests/FunctionalHttpServerTest.php index dcd79b3e..99bdc84e 100644 --- a/tests/FunctionalHttpServerTest.php +++ b/tests/FunctionalHttpServerTest.php @@ -139,6 +139,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"); @@ -172,6 +182,16 @@ public function testSecureHttpsReturnsData() ))); $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(array( 'tls' => array('verify_peer' => false) )); @@ -210,6 +230,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 9e2c7d32..5cb02418 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); } }