We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4265044 commit 8cad2eaCopy full SHA for 8cad2ea
1 file changed
tests/FunctionalResolverTest.php
@@ -32,4 +32,21 @@ public function testResolveInvalidRejects()
32
33
$this->loop->run();
34
}
35
+
36
+ public function testResolveCancelledRejectsImmediately()
37
+ {
38
+ if (!interface_exists('React\Promise\CancellablePromiseInterface')) {
39
+ $this->markTestSkipped();
40
+ }
41
42
+ $promise = $this->resolver->resolve('google.com');
43
+ $promise->then($this->expectCallableNever(), $this->expectCallableOnce());
44
+ $promise->cancel();
45
46
+ $time = microtime(true);
47
+ $this->loop->run();
48
+ $time = microtime(true) - $time;
49
50
+ $this->assertLessThan(0.1, $time);
51
52
0 commit comments