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 226d704 commit 86896efCopy full SHA for 86896ef
1 file changed
tests/React/Promise/LazyPromiseTest.php
@@ -63,4 +63,26 @@ public function shouldReturnPromiseIfFactoryReturnsNull()
63
$p = new LazyPromise($factory);
64
$this->assertInstanceOf('React\\Promise\\PromiseInterface', $p->then());
65
}
66
+
67
+ /** @test */
68
+ public function shouldReturnRejectedPromiseIfFactoryThrowsException()
69
+ {
70
+ $exception = new \Exception();
71
72
+ $factory = $this->createCallableMock();
73
+ $factory
74
+ ->expects($this->once())
75
+ ->method('__invoke')
76
+ ->will($this->throwException($exception));
77
78
+ $errorHandler = $this->createCallableMock();
79
+ $errorHandler
80
81
82
+ ->with($this->identicalTo($exception));
83
84
+ $p = new LazyPromise($factory);
85
86
+ $p->then($this->expectCallableNever(), $errorHandler);
87
+ }
88
0 commit comments