Skip to content
Permalink
Browse files

Fix Response __debugInfo() to get body content

  • Loading branch information...
cleptric committed Nov 3, 2017
1 parent 042d0cd commit 7ee9d21b2a6056004f8056c8935d6a109e74ee07
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 7ee9d21

Please sign in to comment.
You can’t perform that action at this time.