@@ -347,6 +347,7 @@ public function testCloseAfterPingRejectsWillEmitClose()
347347 $ client = $ this ->createMock (StreamingClient::class);
348348 $ client ->expects ($ this ->once ())->method ('__call ' )->willReturn ($ deferred ->promise ());
349349 $ client ->expects ($ this ->once ())->method ('close ' )->willReturnCallback (function () use ($ client ) {
350+ assert ($ client instanceof StreamingClient);
350351 $ client ->emit ('close ' );
351352 });
352353
@@ -356,11 +357,10 @@ public function testCloseAfterPingRejectsWillEmitClose()
356357 $ this ->loop ->expects ($ this ->once ())->method ('addTimer ' )->willReturn ($ timer );
357358 $ this ->loop ->expects ($ this ->once ())->method ('cancelTimer ' )->with ($ timer );
358359
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 ();
362362 });
363- $ ref ->on ('close ' , $ this ->expectCallableOnce ());
363+ $ this -> redis ->on ('close ' , $ this ->expectCallableOnce ());
364364 $ deferred ->reject (new \RuntimeException ());
365365 }
366366
@@ -423,6 +423,7 @@ public function testEmitsNoErrorEventWhenUnderlyingClientEmitsError()
423423 $ deferred ->resolve ($ client );
424424
425425 $ this ->redis ->on ('error ' , $ this ->expectCallableNever ());
426+ assert ($ client instanceof StreamingClient);
426427 $ client ->emit ('error ' , [$ error ]);
427428 }
428429
@@ -438,6 +439,7 @@ public function testEmitsNoCloseEventWhenUnderlyingClientEmitsClose()
438439 $ deferred ->resolve ($ client );
439440
440441 $ this ->redis ->on ('close ' , $ this ->expectCallableNever ());
442+ assert ($ client instanceof StreamingClient);
441443 $ client ->emit ('close ' );
442444 }
443445
0 commit comments