From 356341bc1965425f354be85296712b38488277b9 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Mon, 5 Aug 2019 14:30:21 +0200 Subject: [PATCH] [HttpClient] Minor fixes --- .../FrameworkBundle/DependencyInjection/Configuration.php | 2 +- src/Symfony/Component/HttpClient/Response/MockResponse.php | 4 ++-- src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index b4ce6a2c6a..ba2dbb1a32 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -1481,7 +1481,7 @@ class Configuration implements ConfigurationInterface ->info('A comma separated list of hosts that do not require a proxy to be reached.') ->end() ->floatNode('timeout') - ->info('Defaults to "default_socket_timeout" ini parameter.') + ->info('The idle timeout, defaults to the "default_socket_timeout" ini parameter.') ->end() ->scalarNode('bindto') ->info('A network interface name, IP address, a host name or a UNIX socket to bind to.') diff --git a/src/Symfony/Component/HttpClient/Response/MockResponse.php b/src/Symfony/Component/HttpClient/Response/MockResponse.php index 90bb0df339..fe94bc3436 100644 --- a/src/Symfony/Component/HttpClient/Response/MockResponse.php +++ b/src/Symfony/Component/HttpClient/Response/MockResponse.php @@ -37,7 +37,7 @@ class MockResponse implements ResponseInterface /** * @param string|string[]|iterable $body The response body as a string or an iterable of strings, - * yielding an empty string simulates a timeout, + * yielding an empty string simulates an idle timeout, * exceptions are turned to TransportException * * @see ResponseInterface::getInfo() for possible info, e.g. "response_headers" @@ -277,7 +277,7 @@ class MockResponse implements ResponseInterface if (!\is_string($body)) { foreach ($body as $chunk) { if ('' === $chunk = (string) $chunk) { - // simulate a timeout + // simulate an idle timeout $response->body[] = new ErrorChunk($offset); } else { $response->body[] = $chunk; diff --git a/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php b/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php index 075f73a2c1..7d31a22217 100644 --- a/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php +++ b/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php @@ -580,7 +580,7 @@ abstract class HttpClientTestCase extends TestCase $response = null; $this->expectException(TransportExceptionInterface::class); - $client->request('GET', 'http://symfony.com:8057/', ['timeout' => 3]); + $client->request('GET', 'http://symfony.com:8057/', ['timeout' => 1]); } public function testTimeoutOnAccess() @@ -643,7 +643,6 @@ abstract class HttpClientTestCase extends TestCase { $client = $this->getHttpClient(__FUNCTION__); - $downloaded = 0; $start = microtime(true); $client->request('GET', 'http://localhost:8057/timeout-long'); $client = null;