@@ -37,7 +37,7 @@ public function testPlainHttpOnRandomPort()
3737 return Stream \buffer ($ conn );
3838 });
3939
40- $ response = Block \await ($ result , null , 1.0 );
40+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
4141
4242 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
4343 $ this ->assertContainsString ('http:// ' . noScheme ($ socket ->getAddress ()) . '/ ' , $ response );
@@ -64,7 +64,7 @@ function () {
6464 return Stream \buffer ($ conn );
6565 });
6666
67- $ response = Block \await ($ result , null , 1.0 );
67+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
6868
6969 $ this ->assertContainsString ("HTTP/1.0 404 Not Found " , $ response );
7070
@@ -88,7 +88,7 @@ public function testPlainHttpOnRandomPortWithoutHostHeaderUsesSocketUri()
8888 return Stream \buffer ($ conn );
8989 });
9090
91- $ response = Block \await ($ result , null , 1.0 );
91+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
9292
9393 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
9494 $ this ->assertContainsString ('http:// ' . noScheme ($ socket ->getAddress ()) . '/ ' , $ response );
@@ -113,7 +113,7 @@ public function testPlainHttpOnRandomPortWithOtherHostHeaderTakesPrecedence()
113113 return Stream \buffer ($ conn );
114114 });
115115
116- $ response = Block \await ($ result , null , 1.0 );
116+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
117117
118118 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
119119 $ this ->assertContainsString ('http://localhost:1000/ ' , $ response );
@@ -146,7 +146,7 @@ public function testSecureHttpsOnRandomPort()
146146 return Stream \buffer ($ conn );
147147 });
148148
149- $ response = Block \await ($ result , null , 1.0 );
149+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
150150
151151 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
152152 $ this ->assertContainsString ('https:// ' . noScheme ($ socket ->getAddress ()) . '/ ' , $ response );
@@ -183,7 +183,7 @@ public function testSecureHttpsReturnsData()
183183 return Stream \buffer ($ conn );
184184 });
185185
186- $ response = Block \await ($ result , null , 1.0 );
186+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
187187
188188 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
189189 $ this ->assertContainsString ("\r\nContent-Length: 33000 \r\n" , $ response );
@@ -217,7 +217,7 @@ public function testSecureHttpsOnRandomPortWithoutHostHeaderUsesSocketUri()
217217 return Stream \buffer ($ conn );
218218 });
219219
220- $ response = Block \await ($ result , null , 1.0 );
220+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
221221
222222 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
223223 $ this ->assertContainsString ('https:// ' . noScheme ($ socket ->getAddress ()) . '/ ' , $ response );
@@ -246,7 +246,7 @@ public function testPlainHttpOnStandardPortReturnsUriWithNoPort()
246246 return Stream \buffer ($ conn );
247247 });
248248
249- $ response = Block \await ($ result , null , 1.0 );
249+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
250250
251251 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
252252 $ this ->assertContainsString ('http://127.0.0.1/ ' , $ response );
@@ -275,7 +275,7 @@ public function testPlainHttpOnStandardPortWithoutHostHeaderReturnsUriWithNoPort
275275 return Stream \buffer ($ conn );
276276 });
277277
278- $ response = Block \await ($ result , null , 1.0 );
278+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
279279
280280 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
281281 $ this ->assertContainsString ('http://127.0.0.1/ ' , $ response );
@@ -313,7 +313,7 @@ public function testSecureHttpsOnStandardPortReturnsUriWithNoPort()
313313 return Stream \buffer ($ conn );
314314 });
315315
316- $ response = Block \await ($ result , null , 1.0 );
316+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
317317
318318 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
319319 $ this ->assertContainsString ('https://127.0.0.1/ ' , $ response );
@@ -351,7 +351,7 @@ public function testSecureHttpsOnStandardPortWithoutHostHeaderUsesSocketUri()
351351 return Stream \buffer ($ conn );
352352 });
353353
354- $ response = Block \await ($ result , null , 1.0 );
354+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
355355
356356 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
357357 $ this ->assertContainsString ('https://127.0.0.1/ ' , $ response );
@@ -380,7 +380,7 @@ public function testPlainHttpOnHttpsStandardPortReturnsUriWithPort()
380380 return Stream \buffer ($ conn );
381381 });
382382
383- $ response = Block \await ($ result , null , 1.0 );
383+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
384384
385385 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
386386 $ this ->assertContainsString ('http://127.0.0.1:443/ ' , $ response );
@@ -418,7 +418,7 @@ public function testSecureHttpsOnHttpStandardPortReturnsUriWithPort()
418418 return Stream \buffer ($ conn );
419419 });
420420
421- $ response = Block \await ($ result , null , 1.0 );
421+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
422422
423423 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
424424 $ this ->assertContainsString ('https://127.0.0.1:80/ ' , $ response );
@@ -446,7 +446,7 @@ public function testClosedStreamFromRequestHandlerWillSendEmptyBody()
446446 return Stream \buffer ($ conn );
447447 });
448448
449- $ response = Block \await ($ result , null , 1.0 );
449+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
450450
451451 $ this ->assertStringStartsWith ("HTTP/1.0 200 OK " , $ response );
452452 $ this ->assertStringEndsWith ("\r\n\r\n" , $ response );
@@ -477,7 +477,7 @@ function (RequestInterface $request) use ($once) {
477477 });
478478 });
479479
480- Block \sleep (0.1 );
480+ \ Clue \ React \ Block \await ( \ React \ Promise \ Timer \ sleep (0.1 ) );
481481
482482 $ socket ->close ();
483483 }
@@ -507,7 +507,7 @@ function (RequestInterface $request) use ($stream) {
507507 });
508508
509509 // stream will be closed within 0.1s
510- $ ret = Block \await (Stream \first ($ stream , 'close ' ), null , 0.1 );
510+ $ ret = Block \await (\ React \ Promise \ Timer \timeout ( Stream \first ($ stream , 'close ' ), 0.1 ) );
511511
512512 $ socket ->close ();
513513
@@ -536,7 +536,7 @@ public function testStreamFromRequestHandlerWillBeClosedIfConnectionCloses()
536536 });
537537
538538 // await response stream to be closed
539- $ ret = Block \await (Stream \first ($ stream , 'close ' ), null , 1.0 );
539+ $ ret = Block \await (\ React \ Promise \ Timer \timeout ( Stream \first ($ stream , 'close ' ), 1.0 ) );
540540
541541 $ socket ->close ();
542542
@@ -571,7 +571,7 @@ public function testUpgradeWithThroughStreamReturnsDataAsGiven()
571571 return Stream \buffer ($ conn );
572572 });
573573
574- $ response = Block \await ($ result , null , 1.0 );
574+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
575575
576576 $ this ->assertStringStartsWith ("HTTP/1.1 101 Switching Protocols \r\n" , $ response );
577577 $ this ->assertStringEndsWith ("\r\n\r\nhelloworld " , $ response );
@@ -608,7 +608,7 @@ public function testUpgradeWithRequestBodyAndThroughStreamReturnsDataAsGiven()
608608 return Stream \buffer ($ conn );
609609 });
610610
611- $ response = Block \await ($ result , null , 1.0 );
611+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
612612
613613 $ this ->assertStringStartsWith ("HTTP/1.1 101 Switching Protocols \r\n" , $ response );
614614 $ this ->assertStringEndsWith ("\r\n\r\nhelloworld " , $ response );
@@ -644,7 +644,7 @@ public function testConnectWithThroughStreamReturnsDataAsGiven()
644644 return Stream \buffer ($ conn );
645645 });
646646
647- $ response = Block \await ($ result , null , 1.0 );
647+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
648648
649649 $ this ->assertStringStartsWith ("HTTP/1.1 200 OK \r\n" , $ response );
650650 $ this ->assertStringEndsWith ("\r\n\r\nhelloworld " , $ response );
@@ -684,7 +684,7 @@ public function testConnectWithThroughStreamReturnedFromPromiseReturnsDataAsGive
684684 return Stream \buffer ($ conn );
685685 });
686686
687- $ response = Block \await ($ result , null , 1.0 );
687+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
688688
689689 $ this ->assertStringStartsWith ("HTTP/1.1 200 OK \r\n" , $ response );
690690 $ this ->assertStringEndsWith ("\r\n\r\nhelloworld " , $ response );
@@ -717,7 +717,7 @@ public function testConnectWithClosedThroughStreamReturnsNoData()
717717 return Stream \buffer ($ conn );
718718 });
719719
720- $ response = Block \await ($ result , null , 1.0 );
720+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
721721
722722 $ this ->assertStringStartsWith ("HTTP/1.1 200 OK \r\n" , $ response );
723723 $ this ->assertStringEndsWith ("\r\n\r\n" , $ response );
@@ -760,7 +760,7 @@ function (ServerRequestInterface $request) {
760760 });
761761 }
762762
763- $ responses = Block \await (Promise \all ($ result ), null , 1.0 );
763+ $ responses = Block \await (\ React \ Promise \Timer \timeout ( Promise \ all ($ result ), 1.0 ) );
764764
765765 foreach ($ responses as $ response ) {
766766 $ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response , $ response );
0 commit comments