Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Illuminate/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,23 @@ public function ddHeaders()
exit(1);
}

/**
* Dump the body of the response and end the script.
*
* @param string|null $key
* @return never
*/
public function ddBody($key = null)
{
$content = $this->content();

if (json_validate($content)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this condition should probably also be added to ddJson, if json_validate is strictly required.

$this->ddJson($key);
}

dd($content);
}

/**
* Dump the JSON payload from the response and end the script.
*
Expand Down
Loading