Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Allow BrowserKit relative URL redirect assert#44629
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
c605745 tod864b80Compared864b80 toa720f67Compare| if ($expectedLocation) { | ||
| $constraint = LogicalAnd::fromConstraints($constraint,newResponseConstraint\ResponseHeaderSame('Location',$expectedLocation)); | ||
| if (class_exists(ResponseConstraint\ResponseHeaderLocationSame::class)) { | ||
| $locationConstraint =newResponseConstraint\ResponseHeaderLocationSame(self::getRequest(),$expectedLocation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Would it make sense to have a more genericResponseHeaderUrlSame for all headers consisting of a URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not sure. The behavior forLocation depends on the URL of the request, would this behavior make sense for any kind of URL?
59deba5 to6cdb5d4Comparefabpot commentedOct 1, 2023
Thank you@julienfalque. |
6cdb5d4 tofb4e9aeCompare
In tests, when asserting a redirect happens, it can be convenient to skip the host part in the expected location, assuming it is the same as the one from the request's URL.