From bcf88554b33eb8b6945db40c05cebeb9a5811ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 16 Dec 2023 13:27:41 +0100 Subject: [PATCH] Update test suite to ensure 100% code coverage across Promise v3/v2/v1 --- composer.json | 2 +- tests/Io/StreamingParserTest.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 1791d03..dd09938 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "clue/json-stream": "^0.1", "react/event-loop": "^1.2", "react/http": "^1.8", - "react/promise": "^3 || ^2.0 || ^1.1", + "react/promise": "^3.1 || ^2.11 || ^1.3", "react/promise-stream": "^1.6", "react/socket": "^1.12", "react/stream": "^1.2", diff --git a/tests/Io/StreamingParserTest.php b/tests/Io/StreamingParserTest.php index 7ab1784..1906e19 100644 --- a/tests/Io/StreamingParserTest.php +++ b/tests/Io/StreamingParserTest.php @@ -5,7 +5,6 @@ use Clue\React\Docker\Io\StreamingParser; use Clue\Tests\React\Docker\TestCase; use React\Promise; -use React\Promise\CancellablePromiseInterface; use React\Promise\Deferred; use React\Stream\ThroughStream; @@ -119,11 +118,10 @@ public function testDeferredCancelingPromiseWillCloseStream() $stream->expects($this->once())->method('isReadable')->willReturn(true); $promise = $this->parser->deferredStream($stream); - if (!($promise instanceof CancellablePromiseInterface)) { - $this->markTestSkipped('Requires Promise v2 API and has no effect on v1 API'); - } $stream->expects($this->once())->method('close'); + + assert(method_exists($promise, 'cancel')); $promise->cancel(); }