File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,16 @@ protected function getHttpClient(string $testCase): HttpClientInterface
38
38
public function testBindToPort ()
39
39
{
40
40
$ client = $ this ->getHttpClient (__FUNCTION__ );
41
- $ response = $ client ->request ('GET ' , 'http://localhost:8057 ' , ['bindto ' => '127.0.0.1:9876 ' ]);
41
+ $ localhost = gethostbyname ('localhost ' );
42
+ $ response = $ client ->request ('GET ' , "http:// $ localhost:8057 " , ['bindto ' => "$ localhost:9876 " ]);
42
43
$ response ->getStatusCode ();
43
44
44
45
$ r = new \ReflectionProperty ($ response , 'handle ' );
45
46
$ r ->setAccessible (true );
46
47
47
48
$ curlInfo = curl_getinfo ($ r ->getValue ($ response ));
48
49
49
- self ::assertSame (' 127.0.0.1 ' , $ curlInfo ['local_ip ' ]);
50
+ self ::assertSame ($ localhost , $ curlInfo ['local_ip ' ]);
50
51
self ::assertSame (9876 , $ curlInfo ['local_port ' ]);
51
52
}
52
53
Original file line number Diff line number Diff line change @@ -298,13 +298,15 @@ private static function startVulcain(HttpClientInterface $client)
298
298
self ::markTestSkipped ('Testing with the "vulcain" is not supported on Windows. ' );
299
299
}
300
300
301
- if (['application/json ' ] !== $ client ->request ('GET ' , 'http://127.0.0.1:8057/json ' )->getHeaders ()['content-type ' ]) {
301
+ $ localhost = gethostbyname ('localhost ' );
302
+
303
+ if (['application/json ' ] !== $ client ->request ('GET ' , "http:// $ localhost:8057/json " )->getHeaders ()['content-type ' ]) {
302
304
self ::markTestSkipped ('symfony/http-client-contracts >= 2.0.1 required ' );
303
305
}
304
306
305
307
$ process = new Process (['vulcain ' ], null , [
306
308
'DEBUG ' => 1 ,
307
- 'UPSTREAM ' => ' http://127.0.0.1 :8057 ' ,
309
+ 'UPSTREAM ' => " http:// $ localhost :8057 " ,
308
310
'ADDR ' => ':3000 ' ,
309
311
'KEY_FILE ' => __DIR__ .'/Fixtures/tls/server.key ' ,
310
312
'CERT_FILE ' => __DIR__ .'/Fixtures/tls/server.crt ' ,
Original file line number Diff line number Diff line change 23
23
"require" : {
24
24
"php" : " >=7.2.5" ,
25
25
"psr/log" : " ^1.0" ,
26
- "symfony/http-client-contracts" : " ^ 2.2" ,
26
+ "symfony/http-client-contracts" : " ~ 2.2.1|~2.3.2|^2.4.1 " ,
27
27
"symfony/polyfill-php73" : " ^1.11" ,
28
28
"symfony/polyfill-php80" : " ^1.15" ,
29
29
"symfony/service-contracts" : " ^1.0|^2"
You can’t perform that action at this time.
0 commit comments