Skip to content

Commit

Permalink
[HttpClient] fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Sep 7, 2021
1 parent f4381dc commit c6370fe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Tests/AsyncDecoratorTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpClient\Tests;

use Symfony\Component\HttpClient\AsyncDecoratorTrait;
use Symfony\Component\HttpClient\CurlHttpClient;
use Symfony\Component\HttpClient\DecoratorTrait;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpClient\Response\AsyncContext;
Expand All @@ -32,7 +31,7 @@ protected function getHttpClient(string $testCase, \Closure $chunkFilter = null,
}

if ('testTimeoutOnDestruct' === $testCase) {
return new CurlHttpClient();
return HttpClient::create();
}

$chunkFilter = $chunkFilter ?? static function (ChunkInterface $chunk, AsyncContext $context) { yield $chunk; };
Expand All @@ -58,10 +57,10 @@ public function request(string $method, string $url, array $options = []): Respo
public function testTimeoutOnDestruct()
{
if (HttpClient::create() instanceof NativeHttpClient) {
parent::testTimeoutOnDestruct();
} else {
HttpClientTestCase::testTimeoutOnDestruct();
$this->markTestSkipped('NativeHttpClient doesn\'t support opening concurrent requests.');
}

HttpClientTestCase::testTimeoutOnDestruct();
}

public function testRetry404()
Expand Down

0 comments on commit c6370fe

Please sign in to comment.