8000 minor #37638 [HttpClient] Fix bad testRetryTransportError in AsyncDec… · symfony/symfony@36933f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 36933f2

Browse files
minor #37638 [HttpClient] Fix bad testRetryTransportError in AsyncDecoratorTraitTest (brentybh)
This PR was merged into the 5.2-dev branch. Discussion ---------- [HttpClient] Fix bad testRetryTransportError in AsyncDecoratorTraitTest | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Issues in the test: 1. `TransportExceptionInterface` is not `use`d (imported) 2. The catch block will not be executed (even the above 1 is fixed) because the exception (of `chunked-broken`) will be thrown only when `getContent()` is called The header is OK, status is 200, and we only asserted `getStatusCode()` So this test made no sense. Commits ------- 585536a [HttpClient] Fix bad testRetryTransportError in AsyncDecoratorTraitTest
2 parents 9148770 + 585536a commit 36933f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpClient/Tests/AsyncDecoratorTraitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\HttpClient\Response\AsyncResponse;
1717
use Symfony\Contracts\HttpClient\ChunkInterface;
1818
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
19+
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
1920
use Symfony\Contracts\HttpClient\HttpClientInterface;
2021
use Symfony\Contracts\HttpClient\ResponseInterface;
2122

@@ -68,11 +69,10 @@ public function testRetryTransportError()
6869
if ($chunk->isFirst()) {
6970
$this->assertSame(200, $context->getStatusCode());
7071
}
71-
72-
yield $chunk;
7372
} catch (TransportExceptionInterface $e) {
7473
$context->getResponse()->cancel();
7574
$context->replaceRequest('GET', 'http://localhost:8057/');
75+
$context->passthru();
7676
}
7777
});
7878

0 commit comments

Comments
 (0)
0