-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Reorganize ext/uri tests - withers #19970
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
base: PHP-8.5
Are you sure you want to change the base?
Conversation
ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque2.phpt
Outdated
Show resolved
Hide resolved
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.
The ^ character is in the percent-encode set of the path (https://url.spec.whatwg.org/#path-percent-encode-set), but somehow it's not percent-encoded.
00e380e
to
dd5e549
Compare
dd5e549
to
059b1a1
Compare
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 went through all RFC 3986 tests. Looking pretty good overall, some nits. I also think it would be helpful to print the entire resulting URL in addition to printing the output of the getters, this makes it easier to double-check how exactly the resulting URL will look, particularly with regard to the difference between null
and ""
(e.g. whether there is a ?
for the query or not).
ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt
Outdated
Show resolved
Hide resolved
ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt
Outdated
Show resolved
Hide resolved
<?php | ||
|
||
$uri1 = Uri\Rfc3986\Uri::parse("https://example.com"); | ||
$uri2 = $uri1->withHost("[2001:db8:3333:4444:5555:6666:7777:8888]"); |
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.
$uri2 = $uri1->withHost("[2001:db8:3333:4444:5555:6666:7777:8888]"); | |
$uri2 = $uri1->withHost("[2001:0db8:3333:4444:5555:6666:7777:8888]"); |
Perhaps that to showcase whether or not IPv6 addressed will be normalized?
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.
Good idea!
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.
P.S. I had to realize (again) that IPv6 addresses are not shortened during normalization. During normalization, only the casing of hexadecimal characters is corrected (they are either lowercased or uppercases).
But using an address that could be shortened is a good idea for sure.
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.
This test is just testing that type checks work. I think it can be removed.
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.
This test was originally added by you when you fixed a bug. Do you think it can really be removed?
ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt
Outdated
Show resolved
Hide resolved
Yes, I was also thinking about something similar (at least in some edge cases), but I didn't want to make the output too "crowded". My other concern is that most states can be tested via regular parsing 🤔 (we don't necessary have to use withers for them) |
@TimWolla What do you think about verifying URI recomposition separately? Or do you think we should always test the recomposed URI after URI modification? |
No description provided.