Those still do exists but you need to call them on the response: https://github.com/laravel/framework/pull/38384
And make sure you have v8.55.0
Summer Sale! All accounts are 50% off this week.
Hello,
I remember reading a Taylor Otwell tweet that explains a new feature (last year more or less) to assertInvalid data like this:
$this->assertInvalid(['body' => ['required']]);
https://freek.dev/2096-asserting-valid-and-invalid-requests-in-laravel
Today works but the values passed to the array is the message, not the rule against you want to check.
It was like the "assertHasErrors" of Livewire's.
https://laravel-livewire.com/docs/2.x/input-validation#testing-validation
I'm looking the Laravel framework commits but not lucky at this moment.
@luddinus The array value is a string to check for in the validation failure message; not a rule name. If the validation message does not contain the string “min” then it will not be considered invalid. This is mentioned in the documentation for the method:
https://laravel.com/docs/9.x/http-tests#assert-invalid
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
Please or to participate in this conversation.