@@ -10,7 +10,7 @@ class FunctionTimeoutTest extends TestCase
10
10
{
11
11
public function testResolvedWillResolveRightAway ()
12
12
{
13
- $ promise = Promise \resolve ();
13
+ $ promise = Promise \resolve (null );
14
14
15
15
$ promise = Timer \timeout ($ promise , 3 );
16
16
@@ -19,7 +19,7 @@ public function testResolvedWillResolveRightAway()
19
19
20
20
public function testResolvedExpiredWillResolveRightAway ()
21
21
{
22
- $ promise = Promise \resolve ();
22
+ $ promise = Promise \resolve (null );
23
23
24
24
$ promise = Timer \timeout ($ promise , -1 );
25
25
@@ -28,7 +28,7 @@ public function testResolvedExpiredWillResolveRightAway()
28
28
29
29
public function testResolvedWillNotStartTimer ()
30
30
{
31
- $ promise = Promise \resolve ();
31
+ $ promise = Promise \resolve (null );
32
32
33
33
Timer \timeout ($ promise , 3 );
34
34
@@ -139,7 +139,9 @@ public function testCancelTimeoutWillCancelGivenPromise()
139
139
140
140
public function testCancelGivenPromiseWillReject ()
141
141
{
142
- $ promise = new \React \Promise \Promise (function () { }, function ($ resolve , $ reject ) { $ reject (); });
142
+ $ promise = new \React \Promise \Promise (function () { }, function () {
143
+ throw new \RuntimeException ();
144
+ });
143
145
144
146
$ timeout = Timer \timeout ($ promise , 0.01 );
145
147
@@ -151,7 +153,9 @@ public function testCancelGivenPromiseWillReject()
151
153
152
154
public function testCancelTimeoutWillRejectIfGivenPromiseWillReject ()
153
155
{
154
- $ promise = new \React \Promise \Promise (function () { }, function ($ resolve , $ reject ) { $ reject (); });
156
+ $ promise = new \React \Promise \Promise (function () { }, function () {
157
+ throw new \RuntimeException ();
158
+ });
155
159
156
160
$ timeout = Timer \timeout ($ promise , 0.01 );
157
161
@@ -163,7 +167,9 @@ public function testCancelTimeoutWillRejectIfGivenPromiseWillReject()
163
167
164
168
public function testCancelTimeoutWillResolveIfGivenPromiseWillResolve ()
165
169
{
166
- $ promise = new \React \Promise \Promise (function () { }, function ($ resolve , $ reject ) { $ resolve (); });
170
+ $ promise = new \React \Promise \Promise (function () { }, function ($ resolve ) {
171
+ $ resolve (null );
172
+ });
167
173
168
174
$ timeout = Timer \timeout ($ promise , 0.01 );
169
175
0 commit comments