99use React \Socket \SecureServer ;
1010use React \Socket \TcpConnector ;
1111use React \Socket \TcpServer ;
12- // use function Clue\ React\Block \await;
12+ // use function React\Async \await;
1313// use function React\Promise\all;
1414// use function React\Promise\Timer\timeout;
1515
@@ -40,7 +40,7 @@ public function testClientCanConnectToServer()
4040 $ promise = $ connector ->connect ($ server ->getAddress ());
4141
4242 /* @var ConnectionInterface $client */
43- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
43+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
4444
4545 $ this ->assertInstanceOf ('React\Socket\ConnectionInterface ' , $ client );
4646 $ this ->assertEquals ($ server ->getAddress (), $ client ->getRemoteAddress ());
@@ -69,7 +69,7 @@ public function testClientUsesTls13ByDefaultWhenSupportedByOpenSSL()
6969 $ promise = $ connector ->connect ($ server ->getAddress ());
7070
7171 /* @var ConnectionInterface $client */
72- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
72+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
7373
7474 $ this ->assertInstanceOf ('React\Socket\Connection ' , $ client );
7575 $ this ->assertTrue (isset ($ client ->stream ));
@@ -108,7 +108,7 @@ public function testClientUsesTls12WhenCryptoMethodIsExplicitlyConfiguredByClien
108108 $ promise = $ connector ->connect ($ server ->getAddress ());
109109
110110 /* @var ConnectionInterface $client */
111- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
111+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
112112
113113 $ this ->assertInstanceOf ('React\Socket\Connection ' , $ client );
114114 $ this ->assertTrue (isset ($ client ->stream ));
@@ -139,7 +139,7 @@ public function testClientUsesTls12WhenCryptoMethodIsExplicitlyConfiguredByServe
139139 $ promise = $ connector ->connect ($ server ->getAddress ());
140140
141141 /* @var ConnectionInterface $client */
142- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
142+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
143143
144144 $ this ->assertInstanceOf ('React\Socket\Connection ' , $ client );
145145 $ this ->assertTrue (isset ($ client ->stream ));
@@ -171,7 +171,7 @@ public function testClientUsesTls10WhenCryptoMethodIsExplicitlyConfiguredByClien
171171
172172 /* @var ConnectionInterface $client */
173173 try {
174- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
174+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
175175 } catch (\RuntimeException $ e ) {
176176 // legacy TLS 1.0 would be considered insecure by today's standards, so skip test if connection fails
177177 // OpenSSL error messages are version/platform specific
@@ -213,7 +213,7 @@ public function testServerEmitsConnectionForClientConnection()
213213
214214 // await both client and server side end of connection
215215 /* @var ConnectionInterface[] $both */
216- $ both = \Clue \ React \Block \await (\React \Promise \Timer \timeout (\React \Promise \all (array ($ peer , $ client )), self ::TIMEOUT ));
216+ $ both = \React \Async \await (\React \Promise \Timer \timeout (\React \Promise \all (array ($ peer , $ client )), self ::TIMEOUT ));
217217
218218 // both ends of the connection are represented by different instances of ConnectionInterface
219219 $ this ->assertCount (2 , $ both );
@@ -253,7 +253,7 @@ public function testClientEmitsDataEventOnceForDataWrittenFromServer()
253253 }, $ reject );
254254 });
255255
256- $ data = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
256+ $ data = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
257257
258258 $ this ->assertEquals ('foo ' , $ data );
259259
@@ -294,7 +294,7 @@ public function testWritesDataInMultipleChunksToConnection()
294294 }, $ reject );
295295 });
296296
297- $ received = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
297+ $ received = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
298298
299299 $ this ->assertEquals (400000 , $ received );
300300
@@ -335,7 +335,7 @@ public function testWritesMoreDataInMultipleChunksToConnection()
335335 }, $ reject );
336336 });
337337
338- $ received = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
338+ $ received = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
339339
340340 $ this ->assertEquals (2000000 , $ received );
341341
@@ -368,7 +368,7 @@ public function testEmitsDataFromConnection()
368368 $ connection ->write ('foo ' );
369369 });
370370
371- $ data = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
371+ $ data = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
372372
373373 $ this ->assertEquals ('foo ' , $ data );
374374
@@ -408,7 +408,7 @@ public function testEmitsDataInMultipleChunksFromConnection()
408408 $ connection ->write (str_repeat ('* ' , 400000 ));
409409 });
410410
411- $ received = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
411+ $ received = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
412412
413413 $ this ->assertEquals (400000 , $ received );
414414
@@ -450,7 +450,7 @@ public function testPipesDataBackInMultipleChunksFromConnection()
450450 }, $ reject );
451451 });
452452
453- $ received = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
453+ $ received = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
454454
455455 $ this ->assertEquals (400000 , $ received );
456456
@@ -480,7 +480,7 @@ public function testEmitsConnectionForNewTlsv11Connection()
480480 ));
481481 $ promise = $ connector ->connect ($ server ->getAddress ());
482482
483- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
483+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
484484
485485 $ server ->close ();
486486 $ promise ->then (function (ConnectionInterface $ connection ) {
@@ -511,7 +511,7 @@ public function testEmitsErrorForClientWithTlsVersionMismatch()
511511 $ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
512512
513513 try {
514- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
514+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
515515 } catch (\Exception $ e ) {
516516 $ server ->close ();
517517
@@ -537,7 +537,7 @@ public function testServerEmitsConnectionForNewConnectionWithEncryptedCertificat
537537 ));
538538 $ connector ->connect ($ server ->getAddress ());
539539
540- $ connection = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ peer , self ::TIMEOUT ));
540+ $ connection = \React \Async \await (\React \Promise \Timer \timeout ($ peer , self ::TIMEOUT ));
541541
542542 $ this ->assertInstanceOf ('React\Socket\ConnectionInterface ' , $ connection );
543543
@@ -560,7 +560,7 @@ public function testClientRejectsWithErrorForServerWithInvalidCertificate()
560560 $ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
561561
562562 try {
563- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
563+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
564564 } catch (\Exception $ e ) {
565565 $ server ->close ();
566566
@@ -590,7 +590,7 @@ public function testServerEmitsErrorForClientWithInvalidCertificate()
590590 $ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
591591
592592 try {
593- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ peer , self ::TIMEOUT ));
593+ \React \Async \await (\React \Promise \Timer \timeout ($ peer , self ::TIMEOUT ));
594594 } catch (\Exception $ e ) {
595595 $ server ->close ();
596596
@@ -619,7 +619,7 @@ public function testEmitsErrorForServerWithEncryptedCertificateMissingPassphrase
619619 $ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
620620
621621 try {
622- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
622+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
623623 } catch (\Exception $ e ) {
624624 $ server ->close ();
625625
@@ -649,7 +649,7 @@ public function testEmitsErrorForServerWithEncryptedCertificateWithInvalidPassph
649649 $ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
650650
651651 try {
652- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
652+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
653653 } catch (\Exception $ e ) {
654654 $ server ->close ();
655655
@@ -672,7 +672,7 @@ public function testEmitsErrorForConnectionWithPeerVerification()
672672 $ promise = $ connector ->connect ($ server ->getAddress ());
673673 $ promise ->then (null , $ this ->expectCallableOnce ());
674674
675- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
675+ \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
676676
677677 $ server ->close ();
678678 }
@@ -697,7 +697,7 @@ public function testEmitsErrorIfConnectionIsCancelled()
697697 $ promise ->cancel ();
698698 $ promise ->then (null , $ this ->expectCallableOnce ());
699699
700- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
700+ \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
701701
702702 $ server ->close ();
703703 }
@@ -718,7 +718,7 @@ public function testEmitsErrorIfConnectionIsClosedBeforeHandshake()
718718 $ stream ->close ();
719719 });
720720
721- $ error = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
721+ $ error = \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
722722
723723 // Connection from tcp://127.0.0.1:39528 failed during TLS handshake: Connection lost during TLS handshake (ECONNRESET)
724724 $ this ->assertInstanceOf ('RuntimeException ' , $ error );
@@ -746,7 +746,7 @@ public function testEmitsErrorIfConnectionIsClosedWithIncompleteHandshake()
746746 $ stream ->end ("\x1e" );
747747 });
748748
749- $ error = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
749+ $ error = \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
750750
751751 // Connection from tcp://127.0.0.1:39528 failed during TLS handshake: Connection lost during TLS handshake (ECONNRESET)
752752 $ this ->assertInstanceOf ('RuntimeException ' , $ error );
@@ -770,7 +770,7 @@ public function testEmitsNothingIfPlaintextConnectionIsIdle()
770770 $ connector = new TcpConnector ();
771771 $ promise = $ connector ->connect (str_replace ('tls:// ' , '' , $ server ->getAddress ()));
772772
773- $ connection = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
773+ $ connection = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
774774 $ this ->assertInstanceOf ('React\Socket\ConnectionInterface ' , $ connection );
775775
776776 $ server ->close ();
@@ -795,7 +795,7 @@ public function testEmitsErrorIfConnectionIsHttpInsteadOfSecureHandshake()
795795 $ stream ->write ("GET / HTTP/1.0 \r\n\r\n" );
796796 });
797797
798- $ error = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
798+ $ error = \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
799799
800800 $ this ->assertInstanceOf ('RuntimeException ' , $ error );
801801
@@ -824,7 +824,7 @@ public function testEmitsErrorIfConnectionIsUnknownProtocolInsteadOfSecureHandsh
824824 $ stream ->write ("Hello world! \n" );
825825 });
826826
827- $ error = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
827+ $ error = \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
828828
829829 $ this ->assertInstanceOf ('RuntimeException ' , $ error );
830830
0 commit comments