@@ -268,21 +268,22 @@ public function testTerminateWithStopAndContinueSignalsUsingEventLoop()
268268 $ termSignal = func_get_arg (1 );
269269 });
270270
271- $ loop ->addTimer (0.001 , function (Timer $ timer ) use ($ process ) {
271+ $ that = $ this ;
272+ $ loop ->addTimer (0.001 , function (Timer $ timer ) use ($ process , $ that ) {
272273 $ process ->start ($ timer ->getLoop ());
273274 $ process ->terminate (SIGSTOP );
274275
275- $ this ->assertSoon (function () use ($ process ) {
276- $ this ->assertTrue ($ process ->isStopped ());
277- $ this ->assertTrue ($ process ->isRunning ());
278- $ this ->assertEquals (SIGSTOP , $ process ->getStopSignal ());
276+ $ that ->assertSoon (function () use ($ process, $ that ) {
277+ $ that ->assertTrue ($ process ->isStopped ());
278+ $ that ->assertTrue ($ process ->isRunning ());
279+ $ that ->assertEquals (SIGSTOP , $ process ->getStopSignal ());
279280 });
280281
281282 $ process ->terminate (SIGCONT );
282283
283- $ this ->assertSoon (function () use ($ process ) {
284- $ this ->assertFalse ($ process ->isStopped ());
285- $ this ->assertEquals (SIGSTOP , $ process ->getStopSignal ());
284+ $ that ->assertSoon (function () use ($ process, $ that ) {
285+ $ that ->assertFalse ($ process ->isStopped ());
286+ $ that ->assertEquals (SIGSTOP , $ process ->getStopSignal ());
286287 });
287288 });
288289
@@ -308,12 +309,13 @@ public function testIssue18() {
308309 $ stdOut = '' ;
309310 $ stdErr = '' ;
310311
312+ $ that = $ this ;
311313 $ process ->on (
312314 'exit ' ,
313- function ($ exitCode ) use (&$ stdOut , &$ stdErr , $ testString ) {
314- $ this ->assertEquals (0 , $ exitCode , "Exit code is 0 " );
315+ function ($ exitCode ) use (&$ stdOut , &$ stdErr , $ testString, $ that ) {
316+ $ that ->assertEquals (0 , $ exitCode , "Exit code is 0 " );
315317
316- $ this ->assertEquals ($ testString , $ stdOut );
318+ $ that ->assertEquals ($ testString , $ stdOut );
317319 }
318320 );
319321
0 commit comments