-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Domain required in Phpunit test when redirecting #21189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this is something that needs to be clarified in the documentation instead. |
@xabbuh what's exactly the cause for this? I'd like to create the doc change you suggested, but I don't fully understand this. Thanks! |
@javiereguiluz In the example where we show how to pass the expected path to |
That's what I don't understand ... I've checked some of my tests and I don't use the absolute URL ... and they work 😕 |
It all depends on how you generate the url you later pass to the |
@jakzal it's all clear now! Thanks! |
@javiereguiluz you can see an example here: https://github.com/symfony/symfony-demo/pull/481/files#diff-225f8fc4f30fb429a96063d2612368b3R77 ;) |
@c33s at the end this wasn't a Symfony bug but something that could be better documented. That's why I'm closing this and we're improving the docs at symfony/symfony-docs#7521 Thank you all for your help! |
… (javiereguiluz) This PR was squashed before being merged into the 2.7 branch (closes #7521). Discussion ---------- Added a note about redirections to absolute URLs in tests This fixes symfony/symfony#21189 Commits ------- 8414fb7 Added a note about redirections to absolute URLs in tests
Uh oh!
There was an error while loading. Please reload this page.
the following test, taken from https://symfony.com/doc/current/testing.html#working-with-the-test-client (scroll up to Useful Assertions), shows the example without domain:
doing the same in my tests fails:
routing.yml
I have to include the domain and the protocol to make it work:
The text was updated successfully, but these errors were encountered: