Skip to content

Commit daa4521

Browse files
authored
Merge pull request #84 from clue-labs/cancellation-coverage
Update test suite to ensure 100% code coverage across Promise v3/v2/v1
2 parents 9340132 + bcf8855 commit daa4521

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"clue/json-stream": "^0.1",
1616
"react/event-loop": "^1.2",
1717
"react/http": "^1.8",
18-
"react/promise": "^3 || ^2.0 || ^1.1",
18+
"react/promise": "^3.1 || ^2.11 || ^1.3",
1919
"react/promise-stream": "^1.6",
2020
"react/socket": "^1.12",
2121
"react/stream": "^1.2",

tests/Io/StreamingParserTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Clue\React\Docker\Io\StreamingParser;
66
use Clue\Tests\React\Docker\TestCase;
77
use React\Promise;
8-
use React\Promise\CancellablePromiseInterface;
98
use React\Promise\Deferred;
109
use React\Stream\ThroughStream;
1110

@@ -119,11 +118,10 @@ public function testDeferredCancelingPromiseWillCloseStream()
119118
$stream->expects($this->once())->method('isReadable')->willReturn(true);
120119

121120
$promise = $this->parser->deferredStream($stream);
122-
if (!($promise instanceof CancellablePromiseInterface)) {
123-
$this->markTestSkipped('Requires Promise v2 API and has no effect on v1 API');
124-
}
125121

126122
$stream->expects($this->once())->method('close');
123+
124+
assert(method_exists($promise, 'cancel'));
127125
$promise->cancel();
128126
}
129127

0 commit comments

Comments
 (0)