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 (ter)
  Fix tests (bis)
  [travis] fix travis hopefuly
  [Security] Fix SerializableUser fixture
  [FrameworkBundle][WebProfilerBundle] Don't pass null to string parameters
  • Loading branch information
nicolas-grekas committed Jun 7, 2021
2 parents a1fef56 + 0b97bcf commit 523457b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Tests/CurlHttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ protected function getHttpClient(string $testCase): HttpClientInterface
public function testBindToPort()
{
$client = $this->getHttpClient(__FUNCTION__);
$response = $client->request('GET', 'http://localhost:8057', ['bindto' => '127.0.0.1:9876']);
$localhost = gethostbyname('localhost');
$response = $client->request('GET', "http://$localhost:8057", ['bindto' => "$localhost:9876"]);
$response->getStatusCode();

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

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

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

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

if (['application/json'] !== $client->request('GET', 'http://127.0.0.1:8057/json')->getHeaders()['content-type']) {
$localhost = gethostbyname('localhost');

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

$process = new Process(['vulcain'], null, [
'DEBUG' => 1,
'UPSTREAM' => 'http://127.0.0.1:8057',
'UPSTREAM' => "http://$localhost: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",
"symfony/http-client-contracts": "~2.2.1|~2.3.2|^2.4.1",
"symfony/polyfill-php73": "^1.11",
"symfony/polyfill-php80": "^1.15",
"symfony/service-contracts": "^1.0|^2"
Expand Down

0 comments on commit 523457b

Please sign in to comment.