22
33namespace React \Tests \Socket ;
44
5- use React \Dns \Resolver \Factory ;
6- use React \EventLoop \StreamSelectLoop ;
5+ use Clue \React \Block ;
6+ use React \Dns \Resolver \Factory as ResolverFactory ;
7+ use React \EventLoop \Factory ;
78use React \Socket \Connector ;
9+ use React \Socket \DnsConnector ;
810use React \Socket \SecureConnector ;
911use React \Socket \TcpConnector ;
10- use Clue \React \Block ;
11- use React \Socket \DnsConnector ;
1212
1313class IntegrationTest extends TestCase
1414{
@@ -17,7 +17,7 @@ class IntegrationTest extends TestCase
1717 /** @test */
1818 public function gettingStuffFromGoogleShouldWork ()
1919 {
20- $ loop = new StreamSelectLoop ();
20+ $ loop = Factory:: create ();
2121 $ connector = new Connector ($ loop );
2222
2323 $ conn = Block \await ($ connector ->connect ('google.com:80 ' ), $ loop );
@@ -39,7 +39,7 @@ public function gettingEncryptedStuffFromGoogleShouldWork()
3939 $ this ->markTestSkipped ('Not supported on your platform (outdated HHVM?) ' );
4040 }
4141
42- $ loop = new StreamSelectLoop ();
42+ $ loop = Factory:: create ();
4343 $ secureConnector = new Connector ($ loop );
4444
4545 $ conn = Block \await ($ secureConnector ->connect ('tls://google.com:443 ' ), $ loop );
@@ -58,9 +58,9 @@ public function gettingEncryptedStuffFromGoogleShouldWorkIfHostIsResolvedFirst()
5858 $ this ->markTestSkipped ('Not supported on your platform (outdated HHVM?) ' );
5959 }
6060
61- $ loop = new StreamSelectLoop ();
61+ $ loop = Factory:: create ();
6262
63- $ factory = new Factory ();
63+ $ factory = new ResolverFactory ();
6464 $ dns = $ factory ->create ('8.8.8.8 ' , $ loop );
6565
6666 $ connector = new DnsConnector (
@@ -83,7 +83,7 @@ public function gettingEncryptedStuffFromGoogleShouldWorkIfHostIsResolvedFirst()
8383 /** @test */
8484 public function gettingPlaintextStuffFromEncryptedGoogleShouldNotWork ()
8585 {
86- $ loop = new StreamSelectLoop ();
86+ $ loop = Factory:: create ();
8787 $ connector = new Connector ($ loop );
8888
8989 $ conn = Block \await ($ connector ->connect ('google.com:443 ' ), $ loop );
@@ -101,9 +101,9 @@ public function gettingPlaintextStuffFromEncryptedGoogleShouldNotWork()
101101 /** @test */
102102 public function testConnectingFailsIfDnsUsesInvalidResolver ()
103103 {
104- $ loop = new StreamSelectLoop ();
104+ $ loop = Factory:: create ();
105105
106- $ factory = new Factory ();
106+ $ factory = new ResolverFactory ();
107107 $ dns = $ factory ->create ('demo.invalid ' , $ loop );
108108
109109 $ connector = new Connector ($ loop , array (
@@ -121,7 +121,7 @@ public function testConnectingFailsIfTimeoutIsTooSmall()
121121 $ this ->markTestSkipped ('Not supported on your platform (outdated HHVM?) ' );
122122 }
123123
124- $ loop = new StreamSelectLoop ();
124+ $ loop = Factory:: create ();
125125
126126 $ connector = new Connector ($ loop , array (
127127 'timeout ' => 0.001
@@ -138,7 +138,7 @@ public function testSelfSignedRejectsIfVerificationIsEnabled()
138138 $ this ->markTestSkipped ('Not supported on your platform (outdated HHVM?) ' );
139139 }
140140
141- $ loop = new StreamSelectLoop ();
141+ $ loop = Factory:: create ();
142142
143143 $ connector = new Connector ($ loop , array (
144144 'tls ' => array (
@@ -157,7 +157,7 @@ public function testSelfSignedResolvesIfVerificationIsDisabled()
157157 $ this ->markTestSkipped ('Not supported on your platform (outdated HHVM?) ' );
158158 }
159159
160- $ loop = new StreamSelectLoop ();
160+ $ loop = Factory:: create ();
161161
162162 $ connector = new Connector ($ loop , array (
163163 'tls ' => array (
@@ -171,7 +171,7 @@ public function testSelfSignedResolvesIfVerificationIsDisabled()
171171
172172 public function testCancelPendingConnection ()
173173 {
174- $ loop = new StreamSelectLoop ();
174+ $ loop = Factory:: create ();
175175
176176 $ connector = new TcpConnector ($ loop );
177177 $ pending = $ connector ->connect ('8.8.8.8:80 ' );
0 commit comments