You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: http-tests.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -995,6 +995,12 @@ Assert that the response has an unauthorized (401) HTTP status code:
995
995
Assert that the response view contains given a piece of data:
996
996
997
997
$response->assertViewHas($key, $value = null);
998
+
999
+
Passing a closure as the second argument to the `assertViewHas` method will allow you to inspect and make assertions against a particular piece of view data:
1000
+
1001
+
$response->assertViewHas('user', function (User $user) {
1002
+
return $user->name === 'Taylor';
1003
+
});
998
1004
999
1005
In addition, view data may be accessed as array variables on the response, allowing you to convenient inspect it:
0 commit comments