Skip to content

Commit

Permalink
Add method to dump the content from the response (#17600)
Browse files Browse the repository at this point in the history
  • Loading branch information
cretueusebiu authored and taylorotwell committed Jan 27, 2017
1 parent 88a907c commit d279ea7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Illuminate/Foundation/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,22 @@ protected function session()
{
return app('session.store');
}

/**
* Dump the content from the response.
*
* @return void
*/
public function dump()
{
$content = $this->getContent();

$json = json_decode($content);

if (json_last_error() === JSON_ERROR_NONE) {
$content = $json;
}

dd($content);
}
}

0 comments on commit d279ea7

Please sign in to comment.