Skip to content

Commit d6c0260

Browse files
fix tests (quinter)
1 parent 0b97bcf commit d6c0260

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Tests/CurlHttpClientTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,15 @@ protected function getHttpClient(string $testCase): HttpClientInterface
3838
public function testBindToPort()
3939
{
4040
$client = $this->getHttpClient(__FUNCTION__);
41-
$localhost = gethostbyname('localhost');
42-
$response = $client->request('GET', "http://$localhost:8057", ['bindto' => "$localhost:9876"]);
41+
$response = $client->request('GET', 'http://localhost:8057', ['bindto' => '127.0.0.1:9876']);
4342
$response->getStatusCode();
4443

4544
$r = new \ReflectionProperty($response, 'handle');
4645
$r->setAccessible(true);
4746

4847
$curlInfo = curl_getinfo($r->getValue($response));
4948

50-
self::assertSame($localhost, $curlInfo['local_ip']);
49+
self::assertSame('127.0.0.1', $curlInfo['local_ip']);
5150
self::assertSame(9876, $curlInfo['local_port']);
5251
}
5352

@@ -153,15 +152,13 @@ private function getVulcainClient(): CurlHttpClient
153152
return $client;
154153
}
155154

156-
$localhost = gethostbyname('localhost');
157-
158-
if (['application/json'] !== $client->request('GET', "http://$localhost:8057/json")->getHeaders()['content-type']) {
155+
if (['application/json'] !== $client->request('GET', 'http://127.0.0.1:8057/json')->getHeaders()['content-type']) {
159156
$this->markTestSkipped('symfony/http-client-contracts >= 2.0.1 required');
160157
}
161158

162159
$process = new Process(['vulcain'], null, [
163160
'DEBUG' => 1,
164-
'UPSTREAM' => "http://$localhost:8057",
161+
'UPSTREAM' => 'http://127.0.0.1:8057',
165162
'ADDR' => ':3000',
166163
'KEY_FILE' => __DIR__.'/Fixtures/tls/server.key',
167164
'CERT_FILE' => __DIR__.'/Fixtures/tls/server.crt',

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"require": {
2424
"php": ">=7.1.3",
2525
"psr/log": "^1.0",
26-
"symfony/http-client-contracts": "^1.1.11|~2.1.4|~2.2.1|~2.3.2|^2.4.1",
26+
"symfony/http-client-contracts": "^1.1.10|^2",
2727
"symfony/polyfill-php73": "^1.11",
2828
"symfony/service-contracts": "^1.0|^2"
2929
},

0 commit comments

Comments
 (0)