@@ -40,7 +40,7 @@ public function testResolvedWillNotStartTimer()
4040
4141 public function testRejectedWillRejectRightAway ()
4242 {
43- $ promise = Promise \reject ();
43+ $ promise = Promise \reject (new \ Exception ( ' reject ' ) );
4444
4545 $ promise = Timer \timeout ($ promise , 3 , $ this ->loop );
4646
@@ -49,7 +49,7 @@ public function testRejectedWillRejectRightAway()
4949
5050 public function testRejectedWillNotStartTimer ()
5151 {
52- $ promise = Promise \reject ();
52+ $ promise = Promise \reject (new \ Exception ( ' reject ' ) );
5353
5454 Timer \timeout ($ promise , 3 , $ this ->loop );
5555
@@ -73,10 +73,12 @@ public function testPendingWillRejectOnTimeout()
7373
7474 public function testPendingCancellableWillBeCancelledThroughFollowerOnTimeout ()
7575 {
76- $ cancellable = $ this ->getMockBuilder ('React\Promise\CancellablePromiseInterface ' )->getMock ();
76+ $ cancellableInterface = interface_exists ('React\Promise\CancellablePromiseInterface ' ) ?
77+ 'React\Promise\CancellablePromiseInterface ' : 'React\Promise\PromiseInterface ' ;
78+ $ cancellable = $ this ->getMockBuilder ($ cancellableInterface )->getMock ();
7779 $ cancellable ->expects ($ this ->once ())->method ('cancel ' );
7880
79- $ promise = $ this ->getMockBuilder (' React\Promise\CancellablePromiseInterface ' )->getMock ();
81+ $ promise = $ this ->getMockBuilder ($ cancellableInterface )->getMock ();
8082 $ promise ->expects ($ this ->once ())->method ('then ' )->willReturn ($ cancellable );
8183
8284 Timer \timeout ($ promise , 0.01 , $ this ->loop );
0 commit comments