Skip to content

Commit

Permalink
Merge branch '4.4' into 5.2
Browse files Browse the repository at this point in the history
* 4.4:
  fix tests (quinter)
  • Loading branch information
nicolas-grekas committed Jun 7, 2021
2 parents 523457b + d6c0260 commit 0b66d9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Tests/CurlHttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ protected function getHttpClient(string $testCase): HttpClientInterface
public function testBindToPort()
{
$client = $this->getHttpClient(__FUNCTION__);
$localhost = gethostbyname('localhost');
$response = $client->request('GET', "http://$localhost:8057", ['bindto' => "$localhost:9876"]);
$response = $client->request('GET', 'http://localhost:8057', ['bindto' => '127.0.0.1:9876']);
$response->getStatusCode();

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

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

self::assertSame($localhost, $curlInfo['local_ip']);
self::assertSame('127.0.0.1', $curlInfo['local_ip']);
self::assertSame(9876, $curlInfo['local_port']);
}

Expand Down
6 changes: 2 additions & 4 deletions Tests/HttpClientTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,13 @@ private static function startVulcain(HttpClientInterface $client)
self::markTestSkipped('Testing with the "vulcain" is not supported on Windows.');
}

$localhost = gethostbyname('localhost');

if (['application/json'] !== $client->request('GET', "http://$localhost:8057/json")->getHeaders()['content-type']) {
if (['application/json'] !== $client->request('GET', 'http://127.0.0.1:8057/json')->getHeaders()['content-type']) {
self::markTestSkipped('symfony/http-client-contracts >= 2.0.1 required');
}

$process = new Process(['vulcain'], null, [
'DEBUG' => 1,
'UPSTREAM' => "http://$localhost:8057",
'UPSTREAM' => 'http://127.0.0.1:8057',
'ADDR' => ':3000',
'KEY_FILE' => __DIR__.'/Fixtures/tls/server.key',
'CERT_FILE' => __DIR__.'/Fixtures/tls/server.crt',
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"require": {
"php": ">=7.2.5",
"psr/log": "^1.0",
"symfony/http-client-contracts": "~2.2.1|~2.3.2|^2.4.1",
"symfony/http-client-contracts": "^2.2",
"symfony/polyfill-php73": "^1.11",
"symfony/polyfill-php80": "^1.15",
"symfony/service-contracts": "^1.0|^2"
Expand Down

0 comments on commit 0b66d9c

Please sign in to comment.