@@ -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
@@ -152,13 +153,15 @@ private function getVulcainClient(): CurlHttpClient
152
153
return $ client ;
153
154
}
154
155
155
- if (['application/json ' ] !== $ client ->request ('GET ' , 'http://127.0.0.1:8057/json ' )->getHeaders ()['content-type ' ]) {
156
+ $ localhost = gethostbyname ('localhost ' );
157
+
158
+ if (['application/json ' ] !== $ client ->request ('GET ' , "http:// $ localhost:8057/json " )->getHeaders ()['content-type ' ]) {
156
159
$ this ->markTestSkipped ('symfony/http-client-contracts >= 2.0.1 required ' );
157
160
}
158
161
159
162
$ process = new Process (['vulcain ' ], null , [
160
163
'DEBUG ' => 1 ,
161
- 'UPSTREAM ' => ' http://127.0.0.1 :8057 ' ,
164
+ 'UPSTREAM ' => " http:// $ localhost :8057 " ,
162
165
'ADDR ' => ':3000 ' ,
163
166
'KEY_FILE ' => __DIR__ .'/Fixtures/tls/server.key ' ,
164
167
'CERT_FILE ' => __DIR__ .'/Fixtures/tls/server.crt ' ,
0 commit comments