Laravel - HTTP Tests - Assert View Has All
Assert that the response view has a given list of data:
$response->assertViewHasAll(array $data);
This method may be used to assert that the view simply contains data matching the given keys:
$response->assertViewHasAll([
'name',
'email',
]);
Or, you may assert that the view data is present and has specific values:
$response->assertViewHasAll([
'name' => 'Taylor Otwell',
'email' => '[email protected],',
]);