Update vendor folder

This commit is contained in:
Frédéric Guillot
2020-08-17 21:21:20 -07:00
parent d958ddef2c
commit 81019680fa
81 changed files with 1655 additions and 1683 deletions

View File

@@ -24,8 +24,6 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
*/
abstract class HttpClientTestCase extends TestCase
{
private static $server;
public static function setUpBeforeClass(): void
{
TestHttpServer::start();
@@ -166,7 +164,7 @@ abstract class HttpClientTestCase extends TestCase
$client = $this->getHttpClient(__FUNCTION__);
$response = $client->request('GET', 'http://localhost:8057', ['buffer' => function () {
throw new \Exception('Boo');
throw new \Exception('Boo.');
}]);
$this->assertSame(200, $response->getStatusCode());
@@ -648,7 +646,7 @@ abstract class HttpClientTestCase extends TestCase
$response = $client->request('GET', 'http://localhost:8057/timeout-body', [
'on_progress' => function ($dlNow) {
if (0 < $dlNow) {
throw new \Exception('Aborting the request');
throw new \Exception('Aborting the request.');
}
},
]);
@@ -658,7 +656,7 @@ abstract class HttpClientTestCase extends TestCase
}
$this->fail(ClientExceptionInterface::class.' expected');
} catch (TransportExceptionInterface $e) {
$this->assertSame('Aborting the request', $e->getPrevious()->getMessage());
$this->assertSame('Aborting the request.', $e->getPrevious()->getMessage());
}
$this->assertNotNull($response->getInfo('error'));
@@ -672,7 +670,7 @@ abstract class HttpClientTestCase extends TestCase
$response = $client->request('GET', 'http://localhost:8057/timeout-body', [
'on_progress' => function ($dlNow) {
if (0 < $dlNow) {
throw new \Error('BUG');
throw new \Error('BUG.');
}
},
]);
@@ -682,7 +680,7 @@ abstract class HttpClientTestCase extends TestCase
}
$this->fail('Error expected');
} catch (\Error $e) {
$this->assertSame('BUG', $e->getMessage());
$this->assertSame('BUG.', $e->getMessage());
}
$this->assertNotNull($response->getInfo('error'));
@@ -705,6 +703,23 @@ abstract class HttpClientTestCase extends TestCase
$client->request('GET', 'http://symfony.com:8057/', ['timeout' => 1]);
}
public function testIdnResolve()
{
$client = $this->getHttpClient(__FUNCTION__);
$response = $client->request('GET', 'http://0-------------------------------------------------------------0.com:8057/', [
'resolve' => ['0-------------------------------------------------------------0.com' => '127.0.0.1'],
]);
$this->assertSame(200, $response->getStatusCode());
$response = $client->request('GET', 'http://Bücher.example:8057/', [
'resolve' => ['xn--bcher-kva.example' => '127.0.0.1'],
]);
$this->assertSame(200, $response->getStatusCode());
}
public function testNotATimeout()
{
$client = $this->getHttpClient(__FUNCTION__);
@@ -771,6 +786,30 @@ abstract class HttpClientTestCase extends TestCase
}
}
public function testTimeoutWithActiveConcurrentStream()
{
$p1 = TestHttpServer::start(8067);
$p2 = TestHttpServer::start(8077);
$client = $this->getHttpClient(__FUNCTION__);
$streamingResponse = $client->request('GET', 'http://localhost:8067/max-duration');
$blockingResponse = $client->request('GET', 'http://localhost:8077/timeout-body', [
'timeout' => 0.25,
]);
$this->assertSame(200, $streamingResponse->getStatusCode());
$this->assertSame(200, $blockingResponse->getStatusCode());
$this->expectException(TransportExceptionInterface::class);
try {
$blockingResponse->getContent();
} finally {
$p1->stop();
$p2->stop();
}
}
public function testDestruct()
{
$client = $this->getHttpClient(__FUNCTION__);
@@ -784,6 +823,18 @@ abstract class HttpClientTestCase extends TestCase
$this->assertLessThan(4, $duration);
}
public function testGetContentAfterDestruct()
{
$client = $this->getHttpClient(__FUNCTION__);
try {
$client->request('GET', 'http://localhost:8057/404');
$this->fail(ClientExceptionInterface::class.' expected');
} catch (ClientExceptionInterface $e) {
$this->assertSame('GET', $e->getResponse()->toArray(false)['REQUEST_METHOD']);
}
}
public function testProxy()
{
$client = $this->getHttpClient(__FUNCTION__);