Skip to content

Commit

Permalink
add dumpSession method to TestResponse (#31131)
Browse files Browse the repository at this point in the history
similar to `dumpHeaders` this dumps either all or selected keys from the session.  useful for debugging tests.
  • Loading branch information
browner12 authored and taylorotwell committed Jan 15, 2020
1 parent 4f0cac0 commit 2fb52cb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Illuminate/Foundation/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,23 @@ public function dumpHeaders()
return $this;
}

/**
* Dump the session from the response.
*
* @param array $keys
* @return $this
*/
public function dumpSession($keys = null)
{
if (is_array($keys)) {
dump($this->session()->only($keys));
} else {
dump($this->session()->all());
}

return $this;
}

/**
* Get the streamed content from the response.
*
Expand Down

0 comments on commit 2fb52cb

Please sign in to comment.