44
55use React \EventLoop \Factory ;
66use React \EventLoop \Loop ;
7- use ReflectionClass ;
87
98final class LoopTest extends TestCase
109{
@@ -66,7 +65,7 @@ public function testStaticAddReadStreamWithNoDefaultLoopCallsAddReadStreamOnNewL
6665 {
6766 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
6867 $ ref ->setAccessible (true );
69- $ ref ->setValue (null );
68+ $ ref ->setValue (null , null );
7069
7170 $ stream = stream_socket_server ('127.0.0.1:0 ' );
7271 $ listener = function () { };
@@ -92,7 +91,7 @@ public function testStaticAddWriteStreamWithNoDefaultLoopCallsAddWriteStreamOnNe
9291 {
9392 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
9493 $ ref ->setAccessible (true );
95- $ ref ->setValue (null );
94+ $ ref ->setValue (null , null );
9695
9796 $ stream = stream_socket_server ('127.0.0.1:0 ' );
9897 $ listener = function () { };
@@ -117,7 +116,7 @@ public function testStaticRemoveReadStreamWithNoDefaultLoopIsNoOp()
117116 {
118117 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
119118 $ ref ->setAccessible (true );
120- $ ref ->setValue (null );
119+ $ ref ->setValue (null , null );
121120
122121 $ stream = tmpfile ();
123122 Loop::removeReadStream ($ stream );
@@ -141,7 +140,7 @@ public function testStaticRemoveWriteStreamWithNoDefaultLoopIsNoOp()
141140 {
142141 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
143142 $ ref ->setAccessible (true );
144- $ ref ->setValue (null );
143+ $ ref ->setValue (null , null );
145144
146145 $ stream = tmpfile ();
147146 Loop::removeWriteStream ($ stream );
@@ -169,7 +168,7 @@ public function testStaticAddTimerWithNoDefaultLoopCallsAddTimerOnNewLoopInstanc
169168 {
170169 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
171170 $ ref ->setAccessible (true );
172- $ ref ->setValue (null );
171+ $ ref ->setValue (null , null );
173172
174173 $ interval = 1.0 ;
175174 $ callback = function () { };
@@ -199,7 +198,7 @@ public function testStaticAddPeriodicTimerWithNoDefaultLoopCallsAddPeriodicTimer
199198 {
200199 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
201200 $ ref ->setAccessible (true );
202- $ ref ->setValue (null );
201+ $ ref ->setValue (null , null );
203202
204203 $ interval = 1.0 ;
205204 $ callback = function () { };
@@ -226,7 +225,7 @@ public function testStaticCancelTimerWithNoDefaultLoopIsNoOp()
226225 {
227226 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
228227 $ ref ->setAccessible (true );
229- $ ref ->setValue (null );
228+ $ ref ->setValue (null , null );
230229
231230 $ timer = $ this ->getMockBuilder ('React\EventLoop\TimerInterface ' )->getMock ();
232231 Loop::cancelTimer ($ timer );
@@ -250,7 +249,7 @@ public function testStaticFutureTickWithNoDefaultLoopCallsFutureTickOnNewLoopIns
250249 {
251250 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
252251 $ ref ->setAccessible (true );
253- $ ref ->setValue (null );
252+ $ ref ->setValue (null , null );
254253
255254 $ listener = function () { };
256255 Loop::futureTick ($ listener );
@@ -279,7 +278,7 @@ public function testStaticAddSignalWithNoDefaultLoopCallsAddSignalOnNewLoopInsta
279278
280279 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
281280 $ ref ->setAccessible (true );
282- $ ref ->setValue (null );
281+ $ ref ->setValue (null , null );
283282
284283 $ signal = 1 ;
285284 $ listener = function () { };
@@ -309,7 +308,7 @@ public function testStaticRemoveSignalWithNoDefaultLoopIsNoOp()
309308 {
310309 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
311310 $ ref ->setAccessible (true );
312- $ ref ->setValue (null );
311+ $ ref ->setValue (null , null );
313312
314313 $ signal = 1 ;
315314 $ listener = function () { };
@@ -332,7 +331,7 @@ public function testStaticRunWithNoDefaultLoopCallsRunsOnNewLoopInstance()
332331 {
333332 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
334333 $ ref ->setAccessible (true );
335- $ ref ->setValue (null );
334+ $ ref ->setValue (null , null );
336335
337336 Loop::run ();
338337
@@ -353,7 +352,7 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
353352 {
354353 $ ref = new \ReflectionProperty ('React\EventLoop\Loop ' , 'instance ' );
355354 $ ref ->setAccessible (true );
356- $ ref ->setValue (null );
355+ $ ref ->setValue (null , null );
357356
358357 Loop::stop ();
359358
@@ -366,10 +365,8 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
366365 */
367366 public function unsetLoopFromLoopAccessor ()
368367 {
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 );
374371 }
375372}
0 commit comments