diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index 50177d8a39d5..40a8164ad905 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -861,6 +861,8 @@ public function assertSessionHas($key, $value = null) $this->session()->has($key), "Session is missing expected key [{$key}]." ); + } elseif ($value instanceof Closure) { + PHPUnit::assertTrue($value($this->session()->get($key))); } else { PHPUnit::assertEquals($value, $this->session()->get($key)); }