I've been writing some tests in PHPUnit (version 7.4.3), but in some files in my project (a Laravel 5.7.12 JSON API) I need to use the route (/users/123/posts/456
), but when PHPUnit calls the route, request()->getPathInfo()
returns ""
.
Is there some way to fake this, or fill it with the correct data?
I am calling the route using $this->getJson(route('users.index'));
in the test class.