File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 },
2020 "require" : {
2121 "php" : " >=5.3" ,
22- "react/event-loop" : " ~ 0.4.0|~ 0.3.0 " ,
22+ "react/event-loop" : " ^ 0.4 || ^ 0.3.5 " ,
2323 "react/promise" : " ~2.1|~1.2"
2424 }
2525}
Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ public function testPromiseIsPendingWithoutRunningLoop()
1313 $ this ->expectPromisePending ($ promise );
1414 }
1515
16+ public function testPromiseExpiredIsPendingWithoutRunningLoop ()
17+ {
18+ $ promise = Timer \reject (-1 , $ this ->loop );
19+
20+ $ this ->expectPromisePending ($ promise );
21+ }
22+
1623 public function testPromiseWillBeRejectedOnTimeout ()
1724 {
1825 $ promise = Timer \reject (0.01 , $ this ->loop );
@@ -22,6 +29,15 @@ public function testPromiseWillBeRejectedOnTimeout()
2229 $ this ->expectPromiseRejected ($ promise );
2330 }
2431
32+ public function testPromiseExpiredWillBeRejectedOnTimeout ()
33+ {
34+ $ promise = Timer \reject (-1 , $ this ->loop );
35+
36+ $ this ->loop ->run ();
37+
38+ $ this ->expectPromiseRejected ($ promise );
39+ }
40+
2541 public function testCancelingPromiseWillRejectTimer ()
2642 {
2743 $ promise = Timer \reject (0.01 , $ this ->loop );
Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ public function testPromiseIsPendingWithoutRunningLoop()
1313 $ this ->expectPromisePending ($ promise );
1414 }
1515
16+ public function testPromiseExpiredIsPendingWithoutRunningLoop ()
17+ {
18+ $ promise = Timer \resolve (-1 , $ this ->loop );
19+
20+ $ this ->expectPromisePending ($ promise );
21+ }
22+
1623 public function testPromiseWillBeResolvedOnTimeout ()
1724 {
1825 $ promise = Timer \resolve (0.01 , $ this ->loop );
@@ -22,6 +29,15 @@ public function testPromiseWillBeResolvedOnTimeout()
2229 $ this ->expectPromiseResolved ($ promise );
2330 }
2431
32+ public function testPromiseExpiredWillBeResolvedOnTimeout ()
33+ {
34+ $ promise = Timer \resolve (-1 , $ this ->loop );
35+
36+ $ this ->loop ->run ();
37+
38+ $ this ->expectPromiseResolved ($ promise );
39+ }
40+
2541 public function testWillStartLoopTimer ()
2642 {
2743 $ loop = $ this ->getMock ('React\EventLoop\LoopInterface ' );
Original file line number Diff line number Diff line change @@ -16,6 +16,15 @@ public function testResolvedWillResolveRightAway()
1616 $ this ->expectPromiseResolved ($ promise );
1717 }
1818
19+ public function testResolvedExpiredWillResolveRightAway ()
20+ {
21+ $ promise = Promise \resolve ();
22+
23+ $ promise = Timer \timeout ($ promise , -1 , $ this ->loop );
24+
25+ $ this ->expectPromiseResolved ($ promise );
26+ }
27+
1928 public function testResolvedWillNotStartTimer ()
2029 {
2130 $ promise = Promise \resolve ();
You can’t perform that action at this time.
0 commit comments