Skip to content

Commit 2340b78

Browse files
Merge branch '4.3' into 4.4
* 4.3: [HttpKernel] fix merge fix tests [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted
2 parents 1eb7ee4 + 809a5f4 commit 2340b78

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Test/HttpClientTestCase.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ public function testClientError()
152152
$this->assertSame(404, $response->getStatusCode());
153153
$this->assertSame(['application/json'], $response->getHeaders(false)['content-type']);
154154
$this->assertNotEmpty($response->getContent(false));
155+
156+
$response = $client->request('GET', 'http://localhost:8057/404');
157+
158+
try {
159+
foreach ($client->stream($response) as $chunk) {
160+
$this->assertTrue($chunk->isFirst());
161+
}
162+
$this->fail(ClientExceptionInterface::class.' expected');
163+
} catch (ClientExceptionInterface $e) {
164+
}
155165
}
156166

157167
public function testIgnoreErrors()

0 commit comments

Comments
 (0)