@@ -10,7 +10,7 @@ class FunctionTimeoutTest extends TestCase
1010{
1111 public function testResolvedWillResolveRightAway ()
1212 {
13- $ promise = Promise \resolve ();
13+ $ promise = Promise \resolve (null );
1414
1515 $ promise = Timer \timeout ($ promise , 3 );
1616
@@ -19,7 +19,7 @@ public function testResolvedWillResolveRightAway()
1919
2020 public function testResolvedExpiredWillResolveRightAway ()
2121 {
22- $ promise = Promise \resolve ();
22+ $ promise = Promise \resolve (null );
2323
2424 $ promise = Timer \timeout ($ promise , -1 );
2525
@@ -28,7 +28,7 @@ public function testResolvedExpiredWillResolveRightAway()
2828
2929 public function testResolvedWillNotStartTimer ()
3030 {
31- $ promise = Promise \resolve ();
31+ $ promise = Promise \resolve (null );
3232
3333 Timer \timeout ($ promise , 3 );
3434
@@ -139,7 +139,9 @@ public function testCancelTimeoutWillCancelGivenPromise()
139139
140140 public function testCancelGivenPromiseWillReject ()
141141 {
142- $ promise = new \React \Promise \Promise (function () { }, function ($ resolve , $ reject ) { $ reject (); });
142+ $ promise = new \React \Promise \Promise (function () { }, function () {
143+ throw new \RuntimeException ();
144+ });
143145
144146 $ timeout = Timer \timeout ($ promise , 0.01 );
145147
@@ -151,7 +153,9 @@ public function testCancelGivenPromiseWillReject()
151153
152154 public function testCancelTimeoutWillRejectIfGivenPromiseWillReject ()
153155 {
154- $ promise = new \React \Promise \Promise (function () { }, function ($ resolve , $ reject ) { $ reject (); });
156+ $ promise = new \React \Promise \Promise (function () { }, function () {
157+ throw new \RuntimeException ();
158+ });
155159
156160 $ timeout = Timer \timeout ($ promise , 0.01 );
157161
@@ -163,7 +167,9 @@ public function testCancelTimeoutWillRejectIfGivenPromiseWillReject()
163167
164168 public function testCancelTimeoutWillResolveIfGivenPromiseWillResolve ()
165169 {
166- $ promise = new \React \Promise \Promise (function () { }, function ($ resolve , $ reject ) { $ resolve (); });
170+ $ promise = new \React \Promise \Promise (function () { }, function ($ resolve ) {
171+ $ resolve (null );
172+ });
167173
168174 $ timeout = Timer \timeout ($ promise , 0.01 );
169175
0 commit comments