@@ -37,7 +37,7 @@ public function testClientCanConnectToServer()
37
37
$ promise = $ connector ->connect ($ server ->getAddress ());
38
38
39
39
/* @var ConnectionInterface $client */
40
- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
40
+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
41
41
42
42
$ this ->assertInstanceOf ('React\Socket\ConnectionInterface ' , $ client );
43
43
$ this ->assertEquals ($ server ->getAddress (), $ client ->getRemoteAddress ());
@@ -66,7 +66,7 @@ public function testClientUsesTls13ByDefaultWhenSupportedByOpenSSL()
66
66
$ promise = $ connector ->connect ($ server ->getAddress ());
67
67
68
68
/* @var ConnectionInterface $client */
69
- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
69
+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
70
70
71
71
$ this ->assertInstanceOf ('React\Socket\Connection ' , $ client );
72
72
$ this ->assertTrue (isset ($ client ->stream ));
@@ -105,7 +105,7 @@ public function testClientUsesTls12WhenCryptoMethodIsExplicitlyConfiguredByClien
105
105
$ promise = $ connector ->connect ($ server ->getAddress ());
106
106
107
107
/* @var ConnectionInterface $client */
108
- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
108
+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
109
109
110
110
$ this ->assertInstanceOf ('React\Socket\Connection ' , $ client );
111
111
$ this ->assertTrue (isset ($ client ->stream ));
@@ -136,7 +136,7 @@ public function testClientUsesTls12WhenCryptoMethodIsExplicitlyConfiguredByServe
136
136
$ promise = $ connector ->connect ($ server ->getAddress ());
137
137
138
138
/* @var ConnectionInterface $client */
139
- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
139
+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
140
140
141
141
$ this ->assertInstanceOf ('React\Socket\Connection ' , $ client );
142
142
$ this ->assertTrue (isset ($ client ->stream ));
@@ -168,7 +168,7 @@ public function testClientUsesTls10WhenCryptoMethodIsExplicitlyConfiguredByClien
168
168
169
169
/* @var ConnectionInterface $client */
170
170
try {
171
- $ client = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
171
+ $ client = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
172
172
} catch (\RuntimeException $ e ) {
173
173
// legacy TLS 1.0 would be considered insecure by today's standards, so skip test if connection fails
174
174
// OpenSSL error messages are version/platform specific
@@ -210,7 +210,7 @@ public function testServerEmitsConnectionForClientConnection()
210
210
211
211
// await both client and server side end of connection
212
212
/* @var ConnectionInterface[] $both */
213
- $ both = \Clue \ React \Block \await (\React \Promise \Timer \timeout (\React \Promise \all (array ($ peer , $ client )), self ::TIMEOUT ));
213
+ $ both = \React \Async \await (\React \Promise \Timer \timeout (\React \Promise \all (array ($ peer , $ client )), self ::TIMEOUT ));
214
214
215
215
// both ends of the connection are represented by different instances of ConnectionInterface
216
216
$ this ->assertCount (2 , $ both );
@@ -250,7 +250,7 @@ public function testClientEmitsDataEventOnceForDataWrittenFromServer()
250
250
}, $ reject );
251
251
});
252
252
253
- $ data = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
253
+ $ data = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
254
254
255
255
$ this ->assertEquals ('foo ' , $ data );
256
256
@@ -291,7 +291,7 @@ public function testWritesDataInMultipleChunksToConnection()
291
291
}, $ reject );
292
292
});
293
293
294
- $ received = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
294
+ $ received = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
295
295
296
296
$ this ->assertEquals (400000 , $ received );
297
297
@@ -332,7 +332,7 @@ public function testWritesMoreDataInMultipleChunksToConnection()
332
332
}, $ reject );
333
333
});
334
334
335
- $ received = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
335
+ $ received = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
336
336
337
337
$ this ->assertEquals (2000000 , $ received );
338
338
@@ -365,7 +365,7 @@ public function testEmitsDataFromConnection()
365
365
$ connection ->write ('foo ' );
366
366
});
367
367
368
- $ data = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
368
+ $ data = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
369
369
370
370
$ this ->assertEquals ('foo ' , $ data );
371
371
@@ -405,7 +405,7 @@ public function testEmitsDataInMultipleChunksFromConnection()
405
405
$ connection ->write (str_repeat ('* ' , 400000 ));
406
406
});
407
407
408
- $ received = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
408
+ $ received = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
409
409
410
410
$ this ->assertEquals (400000 , $ received );
411
411
@@ -447,7 +447,7 @@ public function testPipesDataBackInMultipleChunksFromConnection()
447
447
}, $ reject );
448
448
});
449
449
450
- $ received = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
450
+ $ received = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
451
451
452
452
$ this ->assertEquals (400000 , $ received );
453
453
@@ -477,7 +477,7 @@ public function testEmitsConnectionForNewTlsv11Connection()
477
477
));
478
478
$ promise = $ connector ->connect ($ server ->getAddress ());
479
479
480
- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
480
+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
481
481
482
482
$ server ->close ();
483
483
$ promise ->then (function (ConnectionInterface $ connection ) {
@@ -508,7 +508,7 @@ public function testEmitsErrorForClientWithTlsVersionMismatch()
508
508
$ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
509
509
510
510
try {
511
- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
511
+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
512
512
} catch (\Exception $ e ) {
513
513
$ server ->close ();
514
514
@@ -534,7 +534,7 @@ public function testServerEmitsConnectionForNewConnectionWithEncryptedCertificat
534
534
));
535
535
$ connector ->connect ($ server ->getAddress ());
536
536
537
- $ connection = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ peer , self ::TIMEOUT ));
537
+ $ connection = \React \Async \await (\React \Promise \Timer \timeout ($ peer , self ::TIMEOUT ));
538
538
539
539
$ this ->assertInstanceOf ('React\Socket\ConnectionInterface ' , $ connection );
540
540
@@ -557,7 +557,7 @@ public function testClientRejectsWithErrorForServerWithInvalidCertificate()
557
557
$ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
558
558
559
559
try {
560
- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
560
+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
561
561
} catch (\Exception $ e ) {
562
562
$ server ->close ();
563
563
@@ -587,7 +587,7 @@ public function testServerEmitsErrorForClientWithInvalidCertificate()
587
587
$ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
588
588
589
589
try {
590
- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ peer , self ::TIMEOUT ));
590
+ \React \Async \await (\React \Promise \Timer \timeout ($ peer , self ::TIMEOUT ));
591
591
} catch (\Exception $ e ) {
592
592
$ server ->close ();
593
593
@@ -616,7 +616,7 @@ public function testEmitsErrorForServerWithEncryptedCertificateMissingPassphrase
616
616
$ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
617
617
618
618
try {
619
- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
619
+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
620
620
} catch (\Exception $ e ) {
621
621
$ server ->close ();
622
622
@@ -646,7 +646,7 @@ public function testEmitsErrorForServerWithEncryptedCertificateWithInvalidPassph
646
646
$ this ->setExpectedException ('RuntimeException ' , 'handshake ' );
647
647
648
648
try {
649
- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
649
+ \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
650
650
} catch (\Exception $ e ) {
651
651
$ server ->close ();
652
652
@@ -669,7 +669,7 @@ public function testEmitsErrorForConnectionWithPeerVerification()
669
669
$ promise = $ connector ->connect ($ server ->getAddress ());
670
670
$ promise ->then (null , $ this ->expectCallableOnce ());
671
671
672
- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
672
+ \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
673
673
674
674
$ server ->close ();
675
675
}
@@ -694,7 +694,7 @@ public function testEmitsErrorIfConnectionIsCancelled()
694
694
$ promise ->cancel ();
695
695
$ promise ->then (null , $ this ->expectCallableOnce ());
696
696
697
- \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
697
+ \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
698
698
699
699
$ server ->close ();
700
700
}
@@ -715,7 +715,7 @@ public function testEmitsErrorIfConnectionIsClosedBeforeHandshake()
715
715
$ stream ->close ();
716
716
});
717
717
718
- $ error = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
718
+ $ error = \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
719
719
720
720
// Connection from tcp://127.0.0.1:39528 failed during TLS handshake: Connection lost during TLS handshake (ECONNRESET)
721
721
$ this ->assertInstanceOf ('RuntimeException ' , $ error );
@@ -743,7 +743,7 @@ public function testEmitsErrorIfConnectionIsClosedWithIncompleteHandshake()
743
743
$ stream ->end ("\x1e" );
744
744
});
745
745
746
- $ error = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
746
+ $ error = \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
747
747
748
748
// Connection from tcp://127.0.0.1:39528 failed during TLS handshake: Connection lost during TLS handshake (ECONNRESET)
749
749
$ this ->assertInstanceOf ('RuntimeException ' , $ error );
@@ -767,7 +767,7 @@ public function testEmitsNothingIfPlaintextConnectionIsIdle()
767
767
$ connector = new TcpConnector ();
768
768
$ promise = $ connector ->connect (str_replace ('tls:// ' , '' , $ server ->getAddress ()));
769
769
770
- $ connection = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
770
+ $ connection = \React \Async \await (\React \Promise \Timer \timeout ($ promise , self ::TIMEOUT ));
771
771
$ this ->assertInstanceOf ('React\Socket\ConnectionInterface ' , $ connection );
772
772
773
773
$ server ->close ();
@@ -792,7 +792,7 @@ public function testEmitsErrorIfConnectionIsHttpInsteadOfSecureHandshake()
792
792
$ stream ->write ("GET / HTTP/1.0 \r\n\r\n" );
793
793
});
794
794
795
- $ error = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
795
+ $ error = \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
796
796
797
797
$ this ->assertInstanceOf ('RuntimeException ' , $ error );
798
798
@@ -821,7 +821,7 @@ public function testEmitsErrorIfConnectionIsUnknownProtocolInsteadOfSecureHandsh
821
821
$ stream ->write ("Hello world! \n" );
822
822
});
823
823
824
- $ error = \Clue \ React \Block \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
824
+ $ error = \React \Async \await (\React \Promise \Timer \timeout ($ errorEvent , self ::TIMEOUT ));
825
825
826
826
$ this ->assertInstanceOf ('RuntimeException ' , $ error );
827
827
0 commit comments