Skip to content

Commit 5deb95e

Browse files
Merge branch '4.4' into 5.0
* 4.4: [HttpClient] fix "undefined variable" [HttpClient] remove useless code in test [HttpClient] fix getting response content after its destructor throwed an HttpExceptionInterface [HttpClient] fix HttpClientDataCollector when handling canceled responses [Security] Fix exception name in doc comments
2 parents bc289fd + 77fe934 commit 5deb95e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Test/HttpClientTestCase.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,18 @@ public function testDestruct()
782782
$this->assertLessThan(4, $duration);
783783
}
784784

785+
public function testGetContentAfterDestruct()
786+
{
787+
$client = $this->getHttpClient(__FUNCTION__);
788+
789+
try {
790+
$client->request('GET', 'http://localhost:8057/404');
791+
$this->fail(ClientExceptionInterface::class.' expected');
792+
} catch (ClientExceptionInterface $e) {
793+
$this->assertSame('GET', $e->getResponse()->toArray(false)['REQUEST_METHOD']);
794+
}
795+
}
796+
785797
public function testProxy()
786798
{
787799
$client = $this->getHttpClient(__FUNCTION__);

0 commit comments

Comments
 (0)