33namespace React \Tests \Socket ;
44
55use React \Dns \Resolver \Factory as ResolverFactory ;
6+ use React \Socket \ConnectionInterface ;
67use React \Socket \Connector ;
78use React \Socket \DnsConnector ;
89use React \Socket \SecureConnector ;
@@ -19,6 +20,7 @@ public function gettingStuffFromGoogleShouldWork()
1920 $ connector = new Connector (array ());
2021
2122 $ conn = \React \Async \await ($ connector ->connect ('google.com:80 ' ));
23+ assert ($ conn instanceof ConnectionInterface);
2224
2325 $ this ->assertContainsString (':80 ' , $ conn ->getRemoteAddress ());
2426 $ this ->assertNotEquals ('google.com:80 ' , $ conn ->getRemoteAddress ());
@@ -40,6 +42,7 @@ public function gettingEncryptedStuffFromGoogleShouldWork()
4042 $ secureConnector = new Connector (array ());
4143
4244 $ conn = \React \Async \await ($ secureConnector ->connect ('tls://google.com:443 ' ));
45+ assert ($ conn instanceof ConnectionInterface);
4346
4447 $ conn ->write ("GET / HTTP/1.0 \r\n\r\n" );
4548
@@ -66,6 +69,7 @@ public function gettingEncryptedStuffFromGoogleShouldWorkIfHostIsResolvedFirst()
6669 );
6770
6871 $ conn = \React \Async \await ($ connector ->connect ('google.com:443 ' ));
72+ assert ($ conn instanceof ConnectionInterface);
6973
7074 $ conn ->write ("GET / HTTP/1.0 \r\n\r\n" );
7175
@@ -80,6 +84,7 @@ public function gettingPlaintextStuffFromEncryptedGoogleShouldNotWork()
8084 $ connector = new Connector (array ());
8185
8286 $ conn = \React \Async \await ($ connector ->connect ('google.com:443 ' ));
87+ assert ($ conn instanceof ConnectionInterface);
8388
8489 $ this ->assertContainsString (':443 ' , $ conn ->getRemoteAddress ());
8590 $ this ->assertNotEquals ('google.com:443 ' , $ conn ->getRemoteAddress ());
@@ -377,6 +382,7 @@ public function testSelfSignedResolvesIfVerificationIsDisabled()
377382 ));
378383
379384 $ conn = \React \Async \await (\React \Promise \Timer \timeout ($ connector ->connect ('tls://self-signed.badssl.com:443 ' ), self ::TIMEOUT ));
385+ assert ($ conn instanceof ConnectionInterface);
380386 $ conn ->close ();
381387
382388 // if we reach this, then everything is good
0 commit comments