Laravel - HTTP Tests - Assert Invalid
Assert that the response has validation errors for the given keys. This method may be used for asserting against responses where the validation errors are returned as a JSON structure or where the validation errors have been flashed to the session:
$response->assertInvalid(['name', 'email']);
You may also assert that a given key has a particular validation error message. When doing so, you may provide the entire message or only a small portion of the message:
$response->assertInvalid([
'name' => 'The name field is required.',
'email' => 'valid email address',
]);