File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 77 "php" : " >=5.4.0" ,
88 "guzzlehttp/psr7" : " ^1.0" ,
99 "react/event-loop" : " ^1.0 || ^0.5 || ^0.4 || ^0.3" ,
10- "react/socket" : " ^1.0 || ^0.8 || ^0.7 " ,
10+ "react/socket" : " ^1.0 || ^0.8.2 " ,
1111 "react/stream" : " ^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.2" ,
1212 "react/promise" : " ~2.2" ,
1313 "evenement/evenement" : " ^3.0 || ^2.0"
Original file line number Diff line number Diff line change 55use React \EventLoop \Factory ;
66use React \HttpClient \Client ;
77use React \HttpClient \Response ;
8+ use React \Socket \Server ;
9+ use React \Socket \ConnectionInterface ;
810
9- /** @group internet */
1011class FunctionalIntegrationTest extends TestCase
1112{
13+ public function testRequestToLocalhostEmitsSingleRemoteConnection ()
14+ {
15+ $ loop = Factory::create ();
16+
17+ $ server = new Server (0 , $ loop );
18+ $ server ->on ('connection ' , function (ConnectionInterface $ conn ) use ($ server ) {
19+ $ conn ->end ("HTTP/1.1 200 OK \r\n\r\nOk " );
20+ $ server ->close ();
21+ });
22+ $ port = parse_url ($ server ->getAddress (), PHP_URL_PORT );
23+
24+ $ client = new Client ($ loop );
25+ $ request = $ client ->request ('GET ' , 'http://localhost: ' . $ port );
26+ $ request ->end ();
27+
28+ $ loop ->run ();
29+ }
30+
31+ /** @group internet */
1232 public function testSuccessfulResponseEmitsEnd ()
1333 {
1434 $ loop = Factory::create ();
@@ -26,6 +46,7 @@ public function testSuccessfulResponseEmitsEnd()
2646 $ loop ->run ();
2747 }
2848
49+ /** @group internet */
2950 public function testCancelPendingConnectionEmitsClose ()
3051 {
3152 $ loop = Factory::create ();
You can’t perform that action at this time.
0 commit comments