Skip to content

Commit

Permalink
Update test suite to ensure 100% code coverage across Promise v3/v2/v1
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Dec 17, 2023
1 parent 9340132 commit bcf8855
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions tests/Io/StreamingParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit bcf8855

Please sign in to comment.