3
3
namespace React \Tests \Socket ;
4
4
5
5
use React \Dns \Resolver \Factory as ResolverFactory ;
6
+ use React \Socket \ConnectionInterface ;
6
7
use React \Socket \Connector ;
7
8
use React \Socket \DnsConnector ;
8
9
use React \Socket \SecureConnector ;
@@ -19,6 +20,7 @@ public function gettingStuffFromGoogleShouldWork()
19
20
$ connector = new Connector (array ());
20
21
21
22
$ conn = \React \Async \await ($ connector ->connect ('google.com:80 ' ));
23
+ assert ($ conn instanceof ConnectionInterface);
22
24
23
25
$ this ->assertContainsString (':80 ' , $ conn ->getRemoteAddress ());
24
26
$ this ->assertNotEquals ('google.com:80 ' , $ conn ->getRemoteAddress ());
@@ -40,6 +42,7 @@ public function gettingEncryptedStuffFromGoogleShouldWork()
40
42
$ secureConnector = new Connector (array ());
41
43
42
44
$ conn = \React \Async \await ($ secureConnector ->connect ('tls://google.com:443 ' ));
45
+ assert ($ conn instanceof ConnectionInterface);
43
46
44
47
$ conn ->write ("GET / HTTP/1.0 \r\n\r\n" );
45
48
@@ -66,6 +69,7 @@ public function gettingEncryptedStuffFromGoogleShouldWorkIfHostIsResolvedFirst()
66
69
);
67
70
68
71
$ conn = \React \Async \await ($ connector ->connect ('google.com:443 ' ));
72
+ assert ($ conn instanceof ConnectionInterface);
69
73
70
74
$ conn ->write ("GET / HTTP/1.0 \r\n\r\n" );
71
75
@@ -80,6 +84,7 @@ public function gettingPlaintextStuffFromEncryptedGoogleShouldNotWork()
80
84
$ connector = new Connector (array ());
81
85
82
86
$ conn = \React \Async \await ($ connector ->connect ('google.com:443 ' ));
87
+ assert ($ conn instanceof ConnectionInterface);
83
88
84
89
$ this ->assertContainsString (':443 ' , $ conn ->getRemoteAddress ());
85
90
$ this ->assertNotEquals ('google.com:443 ' , $ conn ->getRemoteAddress ());
@@ -377,6 +382,7 @@ public function testSelfSignedResolvesIfVerificationIsDisabled()
377
382
));
378
383
379
384
$ conn = \React \Async \await (\React \Promise \Timer \timeout ($ connector ->connect ('tls://self-signed.badssl.com:443 ' ), self ::TIMEOUT ));
385
+ assert ($ conn instanceof ConnectionInterface);
380
386
$ conn ->close ();
381
387
382
388
// if we reach this, then everything is good
0 commit comments