@@ -37,7 +37,7 @@ public function testPlainHttpOnRandomPort()
37
37
return Stream \buffer ($ conn );
38
38
});
39
39
40
- $ response = Block \await ($ result , null , 1.0 );
40
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
41
41
42
42
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
43
43
$ this ->assertContainsString ('http:// ' . noScheme ($ socket ->getAddress ()) . '/ ' , $ response );
@@ -64,7 +64,7 @@ function () {
64
64
return Stream \buffer ($ conn );
65
65
});
66
66
67
- $ response = Block \await ($ result , null , 1.0 );
67
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
68
68
69
69
$ this ->assertContainsString ("HTTP/1.0 404 Not Found " , $ response );
70
70
@@ -88,7 +88,7 @@ public function testPlainHttpOnRandomPortWithoutHostHeaderUsesSocketUri()
88
88
return Stream \buffer ($ conn );
89
89
});
90
90
91
- $ response = Block \await ($ result , null , 1.0 );
91
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
92
92
93
93
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
94
94
$ this ->assertContainsString ('http:// ' . noScheme ($ socket ->getAddress ()) . '/ ' , $ response );
@@ -113,7 +113,7 @@ public function testPlainHttpOnRandomPortWithOtherHostHeaderTakesPrecedence()
113
113
return Stream \buffer ($ conn );
114
114
});
115
115
116
- $ response = Block \await ($ result , null , 1.0 );
116
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
117
117
118
118
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
119
119
$ this ->assertContainsString ('http://localhost:1000/ ' , $ response );
@@ -146,7 +146,7 @@ public function testSecureHttpsOnRandomPort()
146
146
return Stream \buffer ($ conn );
147
147
});
148
148
149
- $ response = Block \await ($ result , null , 1.0 );
149
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
150
150
151
151
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
152
152
$ this ->assertContainsString ('https:// ' . noScheme ($ socket ->getAddress ()) . '/ ' , $ response );
@@ -183,7 +183,7 @@ public function testSecureHttpsReturnsData()
183
183
return Stream \buffer ($ conn );
184
184
});
185
185
186
- $ response = Block \await ($ result , null , 1.0 );
186
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
187
187
188
188
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
189
189
$ this ->assertContainsString ("\r\nContent-Length: 33000 \r\n" , $ response );
@@ -217,7 +217,7 @@ public function testSecureHttpsOnRandomPortWithoutHostHeaderUsesSocketUri()
217
217
return Stream \buffer ($ conn );
218
218
});
219
219
220
- $ response = Block \await ($ result , null , 1.0 );
220
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
221
221
222
222
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
223
223
$ this ->assertContainsString ('https:// ' . noScheme ($ socket ->getAddress ()) . '/ ' , $ response );
@@ -246,7 +246,7 @@ public function testPlainHttpOnStandardPortReturnsUriWithNoPort()
246
246
return Stream \buffer ($ conn );
247
247
});
248
248
249
- $ response = Block \await ($ result , null , 1.0 );
249
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
250
250
251
251
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
252
252
$ this ->assertContainsString ('http://127.0.0.1/ ' , $ response );
@@ -275,7 +275,7 @@ public function testPlainHttpOnStandardPortWithoutHostHeaderReturnsUriWithNoPort
275
275
return Stream \buffer ($ conn );
276
276
});
277
277
278
- $ response = Block \await ($ result , null , 1.0 );
278
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
279
279
280
280
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
281
281
$ this ->assertContainsString ('http://127.0.0.1/ ' , $ response );
@@ -313,7 +313,7 @@ public function testSecureHttpsOnStandardPortReturnsUriWithNoPort()
313
313
return Stream \buffer ($ conn );
314
314
});
315
315
316
- $ response = Block \await ($ result , null , 1.0 );
316
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
317
317
318
318
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
319
319
$ this ->assertContainsString ('https://127.0.0.1/ ' , $ response );
@@ -351,7 +351,7 @@ public function testSecureHttpsOnStandardPortWithoutHostHeaderUsesSocketUri()
351
351
return Stream \buffer ($ conn );
352
352
});
353
353
354
- $ response = Block \await ($ result , null , 1.0 );
354
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
355
355
356
356
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
357
357
$ this ->assertContainsString ('https://127.0.0.1/ ' , $ response );
@@ -380,7 +380,7 @@ public function testPlainHttpOnHttpsStandardPortReturnsUriWithPort()
380
380
return Stream \buffer ($ conn );
381
381
});
382
382
383
- $ response = Block \await ($ result , null , 1.0 );
383
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
384
384
385
385
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
386
386
$ this ->assertContainsString ('http://127.0.0.1:443/ ' , $ response );
@@ -418,7 +418,7 @@ public function testSecureHttpsOnHttpStandardPortReturnsUriWithPort()
418
418
return Stream \buffer ($ conn );
419
419
});
420
420
421
- $ response = Block \await ($ result , null , 1.0 );
421
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
422
422
423
423
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response );
424
424
$ this ->assertContainsString ('https://127.0.0.1:80/ ' , $ response );
@@ -446,7 +446,7 @@ public function testClosedStreamFromRequestHandlerWillSendEmptyBody()
446
446
return Stream \buffer ($ conn );
447
447
});
448
448
449
- $ response = Block \await ($ result , null , 1.0 );
449
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
450
450
451
451
$ this ->assertStringStartsWith ("HTTP/1.0 200 OK " , $ response );
452
452
$ this ->assertStringEndsWith ("\r\n\r\n" , $ response );
@@ -477,7 +477,7 @@ function (RequestInterface $request) use ($once) {
477
477
});
478
478
});
479
479
480
- Block \sleep (0.1 );
480
+ \ Clue \ React \ Block \await ( \ React \ Promise \ Timer \ sleep (0.1 ) );
481
481
482
482
$ socket ->close ();
483
483
}
@@ -507,7 +507,7 @@ function (RequestInterface $request) use ($stream) {
507
507
});
508
508
509
509
// 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 ) );
511
511
512
512
$ socket ->close ();
513
513
@@ -536,7 +536,7 @@ public function testStreamFromRequestHandlerWillBeClosedIfConnectionCloses()
536
536
});
537
537
538
538
// 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 ) );
540
540
541
541
$ socket ->close ();
542
542
@@ -571,7 +571,7 @@ public function testUpgradeWithThroughStreamReturnsDataAsGiven()
571
571
return Stream \buffer ($ conn );
572
572
});
573
573
574
- $ response = Block \await ($ result , null , 1.0 );
574
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
575
575
576
576
$ this ->assertStringStartsWith ("HTTP/1.1 101 Switching Protocols \r\n" , $ response );
577
577
$ this ->assertStringEndsWith ("\r\n\r\nhelloworld " , $ response );
@@ -608,7 +608,7 @@ public function testUpgradeWithRequestBodyAndThroughStreamReturnsDataAsGiven()
608
608
return Stream \buffer ($ conn );
609
609
});
610
610
611
- $ response = Block \await ($ result , null , 1.0 );
611
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
612
612
613
613
$ this ->assertStringStartsWith ("HTTP/1.1 101 Switching Protocols \r\n" , $ response );
614
614
$ this ->assertStringEndsWith ("\r\n\r\nhelloworld " , $ response );
@@ -644,7 +644,7 @@ public function testConnectWithThroughStreamReturnsDataAsGiven()
644
644
return Stream \buffer ($ conn );
645
645
});
646
646
647
- $ response = Block \await ($ result , null , 1.0 );
647
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
648
648
649
649
$ this ->assertStringStartsWith ("HTTP/1.1 200 OK \r\n" , $ response );
650
650
$ this ->assertStringEndsWith ("\r\n\r\nhelloworld " , $ response );
@@ -684,7 +684,7 @@ public function testConnectWithThroughStreamReturnedFromPromiseReturnsDataAsGive
684
684
return Stream \buffer ($ conn );
685
685
});
686
686
687
- $ response = Block \await ($ result , null , 1.0 );
687
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
688
688
689
689
$ this ->assertStringStartsWith ("HTTP/1.1 200 OK \r\n" , $ response );
690
690
$ this ->assertStringEndsWith ("\r\n\r\nhelloworld " , $ response );
@@ -717,7 +717,7 @@ public function testConnectWithClosedThroughStreamReturnsNoData()
717
717
return Stream \buffer ($ conn );
718
718
});
719
719
720
- $ response = Block \await ($ result , null , 1.0 );
720
+ $ response = Block \await (\ React \ Promise \ Timer \timeout ( $ result , 1.0 ) );
721
721
722
722
$ this ->assertStringStartsWith ("HTTP/1.1 200 OK \r\n" , $ response );
723
723
$ this ->assertStringEndsWith ("\r\n\r\n" , $ response );
@@ -760,7 +760,7 @@ function (ServerRequestInterface $request) {
760
760
});
761
761
}
762
762
763
- $ responses = Block \await (Promise \all ($ result ), null , 1.0 );
763
+ $ responses = Block \await (\ React \ Promise \Timer \timeout ( Promise \ all ($ result ), 1.0 ) );
764
764
765
765
foreach ($ responses as $ response ) {
766
766
$ this ->assertContainsString ("HTTP/1.0 200 OK " , $ response , $ response );
0 commit comments