Issue #3292980 by benjifisher, mikelutz, quietone: Testing system should explain why Guzzle responses can be unreadable

(cherry picked from commit 6b1c5e3d17)
merge-requests/2476/head
Lee Rowlands 2022-07-22 06:47:24 +10:00
parent bb5e69bc34
commit 26dfb364e6
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
1 changed files with 3 additions and 1 deletions

View File

@ -182,7 +182,9 @@ trait BrowserHtmlDebugTrait {
/** @var \Psr\Http\Message\StreamInterface $stream */
$stream = $response->getBody();
// Get the response body as a string.
// Get the response body as a string. The response stream is set
// to the sink, which defaults to a readable temp stream but can
// be overridden by setting $options['sink'].
$body = $stream->isReadable()
? (string) $stream
: 'Response is not readable.';