@@ -334,7 +334,6 @@ public function test304()
334334 public function testRedirects ()
335335 {
336336 $ client = $ this ->getHttpClient (__FUNCTION__ );
337- $ localhost = gethostbyname ('localhost ' );
338337 $ response = $ client ->request ('POST ' , 'http://localhost:8057/301 ' , [
339338 'auth_basic ' => 'foo:bar ' ,
340339 'body ' => function () {
@@ -352,7 +351,7 @@ public function testRedirects()
352351
353352 $ expected = [
354353 'HTTP/1.1 301 Moved Permanently ' ,
355- " Location: http:// $ localhost :8057/302 " ,
354+ ' Location: http://127.0.0.1 :8057/302 ' ,
356355 'Content-Type: application/json ' ,
357356 'HTTP/1.1 302 Found ' ,
358357 'Location: http://localhost:8057/ ' ,
@@ -425,7 +424,6 @@ public function testRedirect307()
425424 public function testMaxRedirects ()
426425 {
427426 $ client = $ this ->getHttpClient (__FUNCTION__ );
428- $ localhost = gethostbyname ('localhost ' );
429427 $ response = $ client ->request ('GET ' , 'http://localhost:8057/301 ' , [
430428 'max_redirects ' => 1 ,
431429 'auth_basic ' => 'foo:bar ' ,
@@ -443,7 +441,7 @@ public function testMaxRedirects()
443441
444442 $ expected = [
445443 'HTTP/1.1 301 Moved Permanently ' ,
446- " Location: http:// $ localhost :8057/302 " ,
444+ ' Location: http://127.0.0.1 :8057/302 ' ,
447445 'Content-Type: application/json ' ,
448446 'HTTP/1.1 302 Found ' ,
449447 'Location: http://localhost:8057/ ' ,
@@ -692,9 +690,8 @@ public function testOnProgressError()
692690 public function testResolve ()
693691 {
694692 $ client = $ this ->getHttpClient (__FUNCTION__ );
695- $ localhost = gethostbyname ('localhost ' );
696693 $ response = $ client ->request ('GET ' , 'http://symfony.com:8057/ ' , [
697- 'resolve ' => ['symfony.com ' => $ localhost ],
694+ 'resolve ' => ['symfony.com ' => ' 127.0.0.1 ' ],
698695 ]);
699696
700697 $ this ->assertSame (200 , $ response ->getStatusCode ());
@@ -708,16 +705,15 @@ public function testResolve()
708705 public function testIdnResolve ()
709706 {
710707 $ client = $ this ->getHttpClient (__FUNCTION__ );
711- $ localhost = gethostbyname ('localhost ' );
712708
713709 $ response = $ client ->request ('GET ' , 'http://0-------------------------------------------------------------0.com:8057/ ' , [
714- 'resolve ' => ['0-------------------------------------------------------------0.com ' => $ localhost ],
710+ 'resolve ' => ['0-------------------------------------------------------------0.com ' => ' 127.0.0.1 ' ],
715711 ]);
716712
717713 $ this ->assertSame (200 , $ response ->getStatusCode ());
718714
719715 $ response = $ client ->request ('GET ' , 'http://Bücher.example:8057/ ' , [
720- 'resolve ' => ['xn--bcher-kva.example ' => $ localhost ],
716+ 'resolve ' => ['xn--bcher-kva.example ' => ' 127.0.0.1 ' ],
721717 ]);
722718
723719 $ this ->assertSame (200 , $ response ->getStatusCode ());
@@ -885,7 +881,7 @@ public function testProxy()
885881
886882 $ body = $ response ->toArray ();
887883 $ this ->assertSame ('localhost:8057 ' , $ body ['HTTP_HOST ' ]);
888- $ this ->assertMatchesRegularExpression ('#^http://(localhost|127\.0\.\d+ \.1):8057/$# ' , $ body ['REQUEST_URI ' ]);
884+ $ this ->assertMatchesRegularExpression ('#^http://(localhost|127\.0\.0 \.1):8057/$# ' , $ body ['REQUEST_URI ' ]);
889885
890886 $ response = $ client ->request ('GET ' , 'http://localhost:8057/ ' , [
891887 'proxy ' => 'http://foo:b%3Dar@localhost:8057 ' ,
0 commit comments