redirect() in action, strange behaviour
I've got the following test:
ViewUserInvitation.php
related parts are:
and
The first assertion in the test passes.
The second fails with count being 3 !== 2
But, when I remove the return redirect()....
, the test passes as expected.3 Replies
Also tested manually. Works as expected with or without the redirect.
not sure, but you can try to move the redirect to the after method
Tried it this way, but no luck, still works as expected, but the test fails.
If I redirect to the
index
page rather than view
the test passes. So strange..
Voila!
If I do the redirect with:
instead of:
It works.
Don't know why particularly, but it's resolves my issue.