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 1362cec commit 5dd458bCopy full SHA for 5dd458b
1 file changed
tests/React/Promise/PromiseTest.php
@@ -14,6 +14,23 @@ public function shouldThrowIfResolverIsNotACallable()
14
15
new Promise(null);
16
}
17
+ /** @test */
18
+ public function shouldRejectIfResolverThrows()
19
+ {
20
+ $e = new \Exception();
21
+
22
+ $promise = new Promise(function() use($e) {
23
+ throw $e;
24
+ });
25
26
+ $mock = $this->createCallableMock();
27
+ $mock
28
+ ->expects($this->once())
29
+ ->method('__invoke')
30
+ ->with($this->identicalTo($e));
31
32
+ $promise->then($this->expectCallableNever(), $mock);
33
+ }
34
35
/** @test */
36
public function shouldResolve()
0 commit comments