Skip to content

Commit

Permalink
Cast $keys to array allowing passing of strings (#31583)
Browse files Browse the repository at this point in the history
  • Loading branch information
aryehraber committed Feb 25, 2020
1 parent 61c887f commit 335ec9c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Illuminate/Foundation/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -1171,15 +1171,17 @@ public function dumpHeaders()
/**
* Dump the session from the response.
*
* @param array $keys
* @param string|array $keys
* @return $this
*/
public function dumpSession($keys = null)
public function dumpSession($keys = [])
{
if (is_array($keys)) {
dump($this->session()->only($keys));
} else {
$keys = (array) $keys;

if (empty($keys)) {
dump($this->session()->all());
} else {
dump($this->session()->only($keys));
}

return $this;
Expand Down

0 comments on commit 335ec9c

Please sign in to comment.