From 2e8e3427c95201398f5f3444ea584cd05d990ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Thu, 6 Jul 2023 12:08:46 +0200 Subject: [PATCH] Update test suite to avoid unhandled promise rejections --- composer.json | 2 +- tests/IntegrationTest.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9cbcaa4..1791d03 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "react/event-loop": "^1.2", "react/http": "^1.8", "react/promise": "^3 || ^2.0 || ^1.1", - "react/promise-stream": "^1.4", + "react/promise-stream": "^1.6", "react/socket": "^1.12", "react/stream": "^1.2", "rize/uri-template": "^0.3" diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 77b39cb..280bd4d 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -4,6 +4,7 @@ use Clue\React\Docker\Client; use Psr\Http\Message\ServerRequestInterface; +use React\Http\Message\Response; use React\Promise\Deferred; class IntegrationTest extends TestCase @@ -26,6 +27,7 @@ public function testPingCtorWithExplicitUnixUrlSendsRequestToGivenUnixSocket() $deferred = new Deferred(); $http = new \React\Http\HttpServer(function (ServerRequestInterface $request) use ($deferred) { $deferred->resolve($request->getRequestTarget()); + return Response::plaintext('OK'); }); $http->listen($socket); @@ -46,6 +48,7 @@ public function testPingCtorWithExplicitHttpUrlSendsRequestToGivenHttpUrlWithBas $deferred = new Deferred(); $http = new \React\Http\HttpServer(function (ServerRequestInterface $request) use ($deferred) { $deferred->resolve($request->getRequestTarget()); + return Response::plaintext('OK'); }); $socket = new \React\Socket\SocketServer('127.0.0.1:0');