In phpunit, how can I check the destination url for my validation failed redirect? (Laravel, PHP)Get the solution ↓↓↓
My form validation is failing and I'm getting redirected back with error messages. In phpunit, how can I check the destination url for my validation failed redirect?
When I try to check $response redirect url like so
I'm getting error:
Response status code  is not a redirect status code.
Here an example of how the redirect url can be set
use Illuminate\Validation\ValidationException; $validationException = new ValidationException($validator); $validationException->redirectTo($redirectUrl);
How can it be tested?
I was using
$response = $this->json('POST', $route, [...
$response = $this->post($route, [...
once I switched to
post the function
People are also looking for solutions of the problem: a non-numeric value encountered in
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.