Permalink
Browse files

Merge pull request #11403 from cakephp/response-debug

Fix Response __debugInfo() to get body content
  • Loading branch information...
markstory committed Nov 3, 2017
2 parents 042d0cd + 7ee9d21 commit 0d51a4890e35bb4bb8ead15b9c8bb8a5236f0144
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/Http/Response.php
  2. +2 −1 tests/TestCase/Http/ResponseTest.php
@@ -2589,7 +2589,7 @@ public function __debugInfo()
'fileRange' => $this->_fileRange,
'cookies' => $this->_cookies,
'cacheDirectives' => $this->_cacheDirectives,
'body' => $this->getBody()->getContents(),
'body' => (string)$this->getBody(),
];
}
}
@@ -3137,6 +3137,7 @@ public function testHasHeader()
public function testDebugInfo()
{
$response = new Response();
$response = $response->withStringBody('Foo');
$result = $response->__debugInfo();
$expected = [
@@ -3149,7 +3150,7 @@ public function testDebugInfo()
'fileRange' => [],
'cookies' => new CookieCollection(),
'cacheDirectives' => [],
'body' => ''
'body' => 'Foo'
];
$this->assertEquals($expected, $result);
}

0 comments on commit 0d51a48

Please sign in to comment.