@@ -347,6 +347,7 @@ public function testCloseAfterPingRejectsWillEmitClose()
347
347
$ client = $ this ->createMock (StreamingClient::class);
348
348
$ client ->expects ($ this ->once ())->method ('__call ' )->willReturn ($ deferred ->promise ());
349
349
$ client ->expects ($ this ->once ())->method ('close ' )->willReturnCallback (function () use ($ client ) {
350
+ assert ($ client instanceof StreamingClient);
350
351
$ client ->emit ('close ' );
351
352
});
352
353
@@ -356,11 +357,10 @@ public function testCloseAfterPingRejectsWillEmitClose()
356
357
$ this ->loop ->expects ($ this ->once ())->method ('addTimer ' )->willReturn ($ timer );
357
358
$ this ->loop ->expects ($ this ->once ())->method ('cancelTimer ' )->with ($ timer );
358
359
359
- $ ref = $ this ->redis ;
360
- $ ref ->ping ()->then (null , function () use ($ ref , $ client ) {
361
- $ ref ->close ();
360
+ $ this ->redis ->ping ()->then (null , function () {
361
+ $ this ->redis ->close ();
362
362
});
363
- $ ref ->on ('close ' , $ this ->expectCallableOnce ());
363
+ $ this -> redis ->on ('close ' , $ this ->expectCallableOnce ());
364
364
$ deferred ->reject (new \RuntimeException ());
365
365
}
366
366
@@ -423,6 +423,7 @@ public function testEmitsNoErrorEventWhenUnderlyingClientEmitsError()
423
423
$ deferred ->resolve ($ client );
424
424
425
425
$ this ->redis ->on ('error ' , $ this ->expectCallableNever ());
426
+ assert ($ client instanceof StreamingClient);
426
427
$ client ->emit ('error ' , [$ error ]);
427
428
}
428
429
@@ -438,6 +439,7 @@ public function testEmitsNoCloseEventWhenUnderlyingClientEmitsClose()
438
439
$ deferred ->resolve ($ client );
439
440
440
441
$ this ->redis ->on ('close ' , $ this ->expectCallableNever ());
442
+ assert ($ client instanceof StreamingClient);
441
443
$ client ->emit ('close ' );
442
444
}
443
445
0 commit comments