4
4
5
5
use React \EventLoop \Factory ;
6
6
use React \EventLoop \Loop ;
7
- use ReflectionClass ;
8
7
9
8
final class LoopTest extends TestCase
10
9
{
@@ -66,7 +65,7 @@ public function testStaticAddReadStreamWithNoDefaultLoopCallsAddReadStreamOnNewL
66
65
{
67
66
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
68
67
$ ref ->setAccessible (true );
69
- $ ref ->setValue (null );
68
+ $ ref ->setValue (null , null );
70
69
71
70
$ stream = stream_socket_server ('127.0.0.1:0 ' );
72
71
$ listener = function () { };
@@ -92,7 +91,7 @@ public function testStaticAddWriteStreamWithNoDefaultLoopCallsAddWriteStreamOnNe
92
91
{
93
92
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
94
93
$ ref ->setAccessible (true );
95
- $ ref ->setValue (null );
94
+ $ ref ->setValue (null , null );
96
95
97
96
$ stream = stream_socket_server ('127.0.0.1:0 ' );
98
97
$ listener = function () { };
@@ -117,7 +116,7 @@ public function testStaticRemoveReadStreamWithNoDefaultLoopIsNoOp()
117
116
{
118
117
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
119
118
$ ref ->setAccessible (true );
120
- $ ref ->setValue (null );
119
+ $ ref ->setValue (null , null );
121
120
122
121
$ stream = tmpfile ();
123
122
Loop::removeReadStream ($ stream );
@@ -141,7 +140,7 @@ public function testStaticRemoveWriteStreamWithNoDefaultLoopIsNoOp()
141
140
{
142
141
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
143
142
$ ref ->setAccessible (true );
144
- $ ref ->setValue (null );
143
+ $ ref ->setValue (null , null );
145
144
146
145
$ stream = tmpfile ();
147
146
Loop::removeWriteStream ($ stream );
@@ -169,7 +168,7 @@ public function testStaticAddTimerWithNoDefaultLoopCallsAddTimerOnNewLoopInstanc
169
168
{
170
169
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
171
170
$ ref ->setAccessible (true );
172
- $ ref ->setValue (null );
171
+ $ ref ->setValue (null , null );
173
172
174
173
$ interval = 1.0 ;
175
174
$ callback = function () { };
@@ -199,7 +198,7 @@ public function testStaticAddPeriodicTimerWithNoDefaultLoopCallsAddPeriodicTimer
199
198
{
200
199
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
201
200
$ ref ->setAccessible (true );
202
- $ ref ->setValue (null );
201
+ $ ref ->setValue (null , null );
203
202
204
203
$ interval = 1.0 ;
205
204
$ callback = function () { };
@@ -226,7 +225,7 @@ public function testStaticCancelTimerWithNoDefaultLoopIsNoOp()
226
225
{
227
226
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
228
227
$ ref ->setAccessible (true );
229
- $ ref ->setValue (null );
228
+ $ ref ->setValue (null , null );
230
229
231
230
$ timer = $ this ->getMockBuilder ('React\EventLoop\TimerInterface ' )->getMock ();
232
231
Loop::cancelTimer ($ timer );
@@ -250,7 +249,7 @@ public function testStaticFutureTickWithNoDefaultLoopCallsFutureTickOnNewLoopIns
250
249
{
251
250
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
252
251
$ ref ->setAccessible (true );
253
- $ ref ->setValue (null );
252
+ $ ref ->setValue (null , null );
254
253
255
254
$ listener = function () { };
256
255
Loop::futureTick ($ listener );
@@ -279,7 +278,7 @@ public function testStaticAddSignalWithNoDefaultLoopCallsAddSignalOnNewLoopInsta
279
278
280
279
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
281
280
$ ref ->setAccessible (true );
282
- $ ref ->setValue (null );
281
+ $ ref ->setValue (null , null );
283
282
284
283
$ signal = 1 ;
285
284
$ listener = function () { };
@@ -309,7 +308,7 @@ public function testStaticRemoveSignalWithNoDefaultLoopIsNoOp()
309
308
{
310
309
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
311
310
$ ref ->setAccessible (true );
312
- $ ref ->setValue (null );
311
+ $ ref ->setValue (null , null );
313
312
314
313
$ signal = 1 ;
315
314
$ listener = function () { };
@@ -332,7 +331,7 @@ public function testStaticRunWithNoDefaultLoopCallsRunsOnNewLoopInstance()
332
331
{
333
332
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
334
333
$ ref ->setAccessible (true );
335
- $ ref ->setValue (null );
334
+ $ ref ->setValue (null , null );
336
335
337
336
Loop::run ();
338
337
@@ -353,7 +352,7 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
353
352
{
354
353
$ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
355
354
$ ref ->setAccessible (true );
356
- $ ref ->setValue (null );
355
+ $ ref ->setValue (null , null );
357
356
358
357
Loop::stop ();
359
358
@@ -366,10 +365,8 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
366
365
*/
367
366
public function unsetLoopFromLoopAccessor ()
368
367
{
369
- $ ref = new ReflectionClass ('\React\EventLoop\Loop ' );
370
- $ prop = $ ref ->getProperty ('instance ' );
371
- $ prop ->setAccessible (true );
372
- $ prop ->setValue (null );
373
- $ prop ->setAccessible (false );
368
+ $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
369
+ $ ref ->setAccessible (true );
370
+ $ ref ->setValue (null , null );
374
371
}
375
372
}
0 commit comments