Skip to content

Commit 523457b

Browse files
Merge branch '4.4' into 5.2
* 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
2 parents a1fef56 + 0b97bcf commit 523457b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Tests/CurlHttpClientTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ protected function getHttpClient(string $testCase): HttpClientInterface
3838
public function testBindToPort()
3939
{
4040
$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"]);
4243
$response->getStatusCode();
4344

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

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

49-
self::assertSame('127.0.0.1', $curlInfo['local_ip']);
50+
self::assertSame($localhost, $curlInfo['local_ip']);
5051
self::assertSame(9876, $curlInfo['local_port']);
5152
}
5253

Tests/HttpClientTestCase.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,15 @@ private static function startVulcain(HttpClientInterface $client)
298298
self::markTestSkipped('Testing with the "vulcain" is not supported on Windows.');
299299
}
300300

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']) {
302304
self::markTestSkipped('symfony/http-client-contracts >= 2.0.1 required');
303305
}
304306

305307
$process = new Process(['vulcain'], null, [
306308
'DEBUG' => 1,
307-
'UPSTREAM' => 'http://127.0.0.1:8057',
309+
'UPSTREAM' => "http://$localhost:8057",
308310
'ADDR' => ':3000',
309311
'KEY_FILE' => __DIR__.'/Fixtures/tls/server.key',
310312
'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.2.5",
2525
"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",
2727
"symfony/polyfill-php73": "^1.11",
2828
"symfony/polyfill-php80": "^1.15",
2929
"symfony/service-contracts": "^1.0|^2"

0 commit comments

Comments
 (0)