ext/uri: Reorganises legacy tests - #23286
Conversation
74844f2 to
d2bfb5c
Compare
kocsismate
left a comment
There was a problem hiding this comment.
partial review yet, I'll continue later
To avoid miscommunication: I plan to address everything in one go when you continued. In case your second pass didn't yield anything new please update me so I know it's done and we do not wait for each other. :) |
I went through all rfc3986 tests now. There are quite a few recurring problems which even apply to the WHATWG URL tests, so please resolve my comments globally, and then I'll continue with another, full review round. |
d2bfb5c to
43b5f64
Compare
Aside: before your review I treated the task as mechanical moves and extractions. So the pre-review state was 1:1 to before this PR ; I didn't check for duplications. I get now what you want. Thing is, I am not exactly confident to decide what qualifies as identical, what differs enough to keep it asserted, and what justifies a removal. I also cannot check each move against all 448 tests, my brain will explode. 😅 I did check the cases you mentioned (+whatwg) -- but if the goal really is to have zero duplicates, I cannot claim that's achieved now. |
kocsismate
left a comment
There was a problem hiding this comment.
Sorry, it's a very long list of review comments, only a few files are left, but I have to take a break now. Feel free to address my comments already.
Sorry if I got you into more than what you subscribed for. :) If you are still patient then we are not that far away from the finish line. I wanted to avoid keeping bad/unnecessary tests from the legacy folder, that's why I did such a "strict" review. I hope that you understand it :) |
Nah,that's all good. Really just wanted to let you know that I will have to rely on your deeper knowledge of the domain. Will pick up on the comments soon! :) |
Co-authored-by: Máté Kocsis <kocsismate90@gmail.com>
c2f6384 to
72c11be
Compare
| } catch (Throwable $e) { | ||
| echo $e::class, ": ", $e->getMessage(), PHP_EOL; | ||
| echo $e::class, ': ', $e->getMessage(), "\n"; | ||
| var_dump($e->errors[0]->type === Uri\WhatWg\UrlValidationErrorType::PortOutOfRange); |
There was a problem hiding this comment.
Added this because the other test has it too.
| <?php | ||
|
|
||
| $errors = []; | ||
| $url = Uri\WhatWg\Url::parse("🐘", null, $errors); |
There was a problem hiding this comment.
Not exactly the same as the one with emoji in host.
|
Should be done @kocsismate.
Notes:
Failure unrelated. |
kocsismate
left a comment
There was a problem hiding this comment.
I went through all tests and they look fine now with only the following exceptions:
| @@ -1,5 +1,5 @@ | |||
| --TEST-- | |||
| Test Uri\Rfc3986\Uri getter - uri type - Absolute path reference | |||
| Test Uri\Rfc3986\Uri component retrieval - URI type - absolute-path reference | |||
There was a problem hiding this comment.
tbh these tests didn't use "component retrieval", because URI type is not a URI component, so the original wording was better.
There was a problem hiding this comment.
Done. Included in next push.
| @@ -1,5 +1,5 @@ | |||
| --TEST-- | |||
| Test Uri\Rfc3986\Uri component modification - fragment - empty string | |||
| Test Uri\Rfc3986\Uri component modification - fragment - success - empty string | |||
There was a problem hiding this comment.
The component modification test names were indeed inconsistent with parsing test names, but maybe using the method name in the first group is better than having 4 groups.
However, I'd prefer not to add more things into this PR because reviewing it already took me 4+ hours, so I would love to finish it soon.
There was a problem hiding this comment.
Will make it a follow up.
| @@ -0,0 +1,22 @@ | |||
| --TEST-- | |||
| Test Uri\Rfc3986\Uri component modification - host - success - percent-encoded reserved characters | |||
There was a problem hiding this comment.
| Test Uri\Rfc3986\Uri component modification - host - success - percent-encoded reserved characters | |
| Test Uri\Rfc3986\Uri component modification - host - percent-encoded characters |
There was a problem hiding this comment.
Only this one or all that have success? Why elsewhere adding success and here not?
There was a problem hiding this comment.
I will leave this alone for now and make it part of the follow up. When we remove 'success' it's inconsistent. When we remove 'reserved' it's the same as in host_success_encoded.phpt which is confusing. With the follow up success/error makes more sense again. Could be from:
Test Uri\Rfc3986\Uri component modification - host - success - percent-encoded reserved characters
Test Uri\Rfc3986\Uri component modification - host - error - reserved characters
to
Test Uri\Rfc3986\Uri::withHost() - success - percent-encoded reserved characters
Test Uri\Rfc3986\Uri::withHost() - error - reserved characters
So I am not going the success remove, nor the reserved here if you are fine with it.
| @@ -0,0 +1,10 @@ | |||
| --TEST-- | |||
| Test Uri\Rfc3986\Uri parsing - query - emoji code point | |||
There was a problem hiding this comment.
FYI: RFC 3986 uses the "character" naming, while WHATWG uses "code point".
There was a problem hiding this comment.
Changed in two tests. Included in next push.
| @@ -0,0 +1,25 @@ | |||
| --TEST-- | |||
| Test Uri\WhatWg\Url parsing - basic - parse() returns null for an emoji relative reference | |||
There was a problem hiding this comment.
WHATWG uses relative-URL instead of relative reference
There was a problem hiding this comment.
Done in 6 files. Included in next push.
| @@ -0,0 +1,35 @@ | |||
| --TEST-- | |||
| Test Uri\WhatWg\Url reference resolution - resolve() - relative reference | |||
There was a problem hiding this comment.
| Test Uri\WhatWg\Url reference resolution - resolve() - relative reference | |
| Test Uri\WhatWg\Url reference resolution - resolve() - relative-URL |
There was a problem hiding this comment.
Same batch as above.
That's done in 3ec9180; expect the pre-existing inconsistency. For those I'll send a follow up as requested above! |
Ref: #23271 (review) @kocsismate
Depends on: #23271 (
ready here, but marked as draft until 23271 is merged)Coverage