From c0352c2c0e139879a033f52e4c9fef6575ba7469 Mon Sep 17 00:00:00 2001 From: NickSdot <32384907+NickSdot@users.noreply.github.com> Date: Fri, 4 Sep 2026 16:43:53 +0700 Subject: [PATCH 1/7] ext/uri: Reorganises legacy tests (#23286) --- ext/uri/tests/003.phpt | 89 --------- ext/uri/tests/004.phpt | 83 -------- ext/uri/tests/006.phpt | 49 ----- ext/uri/tests/007.phpt | 68 ------- ext/uri/tests/008.phpt | 76 -------- ext/uri/tests/009.phpt | 46 ----- ext/uri/tests/010.phpt | 84 --------- ext/uri/tests/011.phpt | 31 --- ext/uri/tests/012.phpt | 85 --------- ext/uri/tests/013.phpt | 129 ------------- ext/uri/tests/014.phpt | 13 -- ext/uri/tests/018.phpt | 89 --------- ext/uri/tests/019.phpt | 61 ------ ext/uri/tests/023.phpt | 61 ------ ext/uri/tests/024.phpt | 27 --- ext/uri/tests/025.phpt | 27 --- ext/uri/tests/026.phpt | 137 -------------- ext/uri/tests/026_userinfo.phpt | 51 ----- ext/uri/tests/027.phpt | 73 ------- ext/uri/tests/028.phpt | 87 --------- ext/uri/tests/029.phpt | 93 --------- ext/uri/tests/030.phpt | 69 ------- ext/uri/tests/031.phpt | 178 ------------------ ext/uri/tests/033.phpt | 19 -- ext/uri/tests/038.phpt | 40 ---- ext/uri/tests/039.phpt | 76 -------- ext/uri/tests/040.phpt | 53 ------ ext/uri/tests/041.phpt | 45 ----- ext/uri/tests/042.phpt | 48 ----- ext/uri/tests/043.phpt | 155 --------------- ext/uri/tests/045.phpt | 23 --- ext/uri/tests/046.phpt | 87 --------- ext/uri/tests/047.phpt | 55 ------ ext/uri/tests/049.phpt | 17 -- ext/uri/tests/050.phpt | 21 --- ext/uri/tests/051.phpt | 42 ----- ext/uri/tests/065.phpt | 115 ----------- .../host_error_ipv6_closing_brace.phpt | 2 +- .../general/array_cast_success.phpt} | 7 +- .../tests/rfc3986/general/clone_success.phpt | 37 ++++ .../constructor_error_reinitialization.phpt | 40 ++++ .../general/extension_error.phpt} | 0 ...nstantiate_without_constructor_error.phpt} | 10 +- ...ic_success_percent_encoded_components.phpt | 44 +++++ .../host_error_unset_with_userinfo.phpt | 16 ++ .../host_success_ipv4_to_ipv6.phpt | 22 +++ ...host_success_percent_encoded_reserved.phpt | 22 +++ .../modification/port_error_missing_host.phpt | 16 ++ .../modification/port_success_empty_host.phpt | 18 ++ .../port_success_unset_without_host.phpt | 18 ++ .../normalization/percent_encoding.phpt} | 2 +- ...emoji_relative_reference_returns_null.phpt | 10 + .../basic_error_invalid_uris_return_null.phpt | 14 ++ .../parsing/basic_error_relative_base.phpt} | 3 +- .../parsing/basic_success_constructor.phpt | 33 ++++ .../parsing/host_error_multibyte_emoji.phpt | 10 + ..._success_empty_network_path_reference.phpt | 33 ++++ ...ccess_ipv4_octal_like_registered_name.phpt | 35 ++++ ..._success_ipvfuture_relative_reference.phpt | 33 ++++ ...path_success_multiple_leading_slashes.phpt | 33 ++++ .../parsing/path_success_percent_encoded.phpt | 33 ++++ ...th_success_relative_reference_network.phpt | 33 ++++ ...th_success_relative_reference_numeric.phpt | 33 ++++ .../parsing/path_success_special_chars.phpt | 33 ++++ .../parsing/port_error_overflow.phpt} | 4 +- .../parsing/query_error_multibyte.phpt | 10 + .../parsing/query_error_multibyte_emoji.phpt | 10 + .../rfc3986/parsing/query_error_special.phpt | 10 + .../query_success_percent_encoded.phpt | 33 ++++ ...query_success_percent_encoded_special.phpt | 33 ++++ .../rfc3986/parsing/query_success_plus.phpt | 33 ++++ .../parse_success_absolute_with_base.phpt | 33 ++++ .../parse_success_relative_with_base.phpt | 33 ++++ .../resolve_error_unicode.phpt | 16 ++ .../resolve_success_absolute_uri.phpt | 37 ++++ .../resolve_success_relative_reference.phpt | 37 ++++ .../rfc3986/serialization/basic_success.phpt | 40 ++++ .../serialization/json_encode_success.phpt} | 6 +- .../unserialize_error_invalid_data.phpt | 63 +++++++ .../unserialize_error_legacy_format.phpt | 11 ++ .../unserialize_error_reinitialization.phpt | 40 ++++ .../whatwg/builder/basic_error_with_base.phpt | 2 +- .../host_error_ipv6_closing_brace_opaque.phpt | 2 +- ...host_error_ipv6_closing_brace_special.phpt | 2 +- .../builder/host_error_null_special.phpt | 4 +- .../builder/host_error_percent_encoding1.phpt | 2 +- .../builder/host_error_percent_encoding2.phpt | 2 +- .../builder/host_error_percent_encoding3.phpt | 2 +- .../password_error_empty_opaque_host.phpt | 2 +- .../builder/password_error_file_scheme.phpt | 2 +- .../builder/password_error_missing_host.phpt | 2 +- .../password_error_missing_opaque_host.phpt | 2 +- .../builder/port_error_empty_opaque_host.phpt | 2 +- .../builder/port_error_file_scheme.phpt | 2 +- .../port_error_file_with_host_and_port.phpt | 2 +- .../whatwg/builder/port_error_large.phpt | 2 +- .../port_error_missing_opaque_host.phpt | 2 +- .../whatwg/builder/port_error_negative.phpt | 2 +- .../scheme_error_c0_control_space_char.phpt | 2 +- .../whatwg/builder/scheme_error_empty.phpt | 2 +- .../builder/scheme_error_first_char.phpt | 2 +- .../builder/scheme_error_special_char.phpt | 2 +- .../username_error_empty_opaque_host.phpt | 2 +- .../builder/username_error_file_scheme.phpt | 2 +- .../username_error_missing_opaque_host.phpt | 2 +- ...id_url_exception_constructor_reentry.phpt} | 2 +- ...validation_error_constructor_reentry.phpt} | 2 +- .../whatwg/general/array_cast_success.phpt | 11 ++ .../tests/whatwg/general/clone_success.phpt | 35 ++++ .../constructor_error_reinitialization.phpt | 38 ++++ .../general/extension_error.phpt} | 0 ...instantiate_without_constructor_error.phpt | 18 ++ .../general/memory_management.phpt} | 4 +- ...ic_success_percent_encoded_components.phpt | 28 +++ ...rror_forbidden_host_codepoint_opaque3.phpt | 2 +- .../host_success_ipv4_to_ipv6.phpt | 18 ++ .../modification/port_error_too_large.phpt | 4 +- .../modification/port_success_empty_host.phpt | 1 + .../port_success_file_scheme.phpt | 18 ++ .../username_success_encoded.phpt | 18 ++ .../username_success_file_scheme.phpt | 18 ++ ...emoji_relative_reference_returns_null.phpt | 25 +++ .../parsing/basic_success_constructor.phpt | 31 +++ ...sic_success_invalid_url_unit_warnings.phpt | 53 ++++++ .../parsing/basic_success_multibyte.phpt} | 5 +- ...rrors_error_typed_property_reference.phpt} | 6 +- .../parsing/host_success_ipv4_fullwidth.phpt | 31 +++ .../parsing/host_success_ipv4_octal.phpt | 31 +++ .../parsing/host_success_ipv6_short.phpt | 31 +++ .../parsing/host_success_multibyte.phpt | 2 +- .../parsing/host_success_multibyte_emoji.phpt | 33 ++++ .../parsing/password_success_multibyte.phpt | 2 +- .../password_success_percent_encode_set.phpt | 2 +- ...ath_success_file_backslash_and_spaces.phpt | 31 +++ .../parsing/path_success_multibyte_emoji.phpt | 31 +++ .../path_success_percent_encode_set2.phpt | 2 +- .../parsing/path_success_percent_encoded.phpt | 31 +++ .../parsing/port_error_too_large.phpt} | 6 +- .../parsing/query_success_multibyte.phpt | 31 +++ .../query_success_multibyte_emoji.phpt | 31 +++ .../query_success_percent_encoded.phpt | 31 +++ ...query_success_percent_encoded_special.phpt | 31 +++ .../whatwg/parsing/query_success_plus.phpt | 31 +++ .../whatwg/parsing/query_success_special.phpt | 31 +++ .../parsing/scheme_error_multibyte.phpt | 2 +- .../scheme_success_extra_slashes.phpt} | 14 +- .../parsing/username_success_multibyte.phpt | 2 +- .../username_success_percent_encode_set.phpt | 2 +- .../parse_success_absolute_with_base.phpt | 31 +++ .../parse_success_relative_with_base.phpt | 31 +++ .../resolve_error_ipv4_too_many_parts.phpt | 16 ++ .../resolve_success_absolute_url.phpt | 35 ++++ ...lve_success_invalid_url_unit_warnings.phpt | 48 +++++ .../resolve_success_relative_reference.phpt | 35 ++++ .../whatwg/serialization/basic_success.phpt | 36 ++++ .../serialization/json_encode_success.phpt | 10 + .../unserialize_error_invalid_data.phpt | 70 +++++++ .../unserialize_error_legacy_format.phpt | 12 ++ .../unserialize_error_reinitialization.phpt | 38 ++++ ...nternal_api_error_whatwg_invalid_url.phpt} | 8 +- ...ternal_api_success_parse_url_parsing.phpt} | 0 ...ernal_api_success_rfc3986_large_port.phpt} | 2 +- 162 files changed, 2153 insertions(+), 2586 deletions(-) delete mode 100644 ext/uri/tests/003.phpt delete mode 100644 ext/uri/tests/004.phpt delete mode 100644 ext/uri/tests/006.phpt delete mode 100644 ext/uri/tests/007.phpt delete mode 100644 ext/uri/tests/008.phpt delete mode 100644 ext/uri/tests/009.phpt delete mode 100644 ext/uri/tests/010.phpt delete mode 100644 ext/uri/tests/011.phpt delete mode 100644 ext/uri/tests/012.phpt delete mode 100644 ext/uri/tests/013.phpt delete mode 100644 ext/uri/tests/014.phpt delete mode 100644 ext/uri/tests/018.phpt delete mode 100644 ext/uri/tests/019.phpt delete mode 100644 ext/uri/tests/023.phpt delete mode 100644 ext/uri/tests/024.phpt delete mode 100644 ext/uri/tests/025.phpt delete mode 100644 ext/uri/tests/026.phpt delete mode 100644 ext/uri/tests/026_userinfo.phpt delete mode 100644 ext/uri/tests/027.phpt delete mode 100644 ext/uri/tests/028.phpt delete mode 100644 ext/uri/tests/029.phpt delete mode 100644 ext/uri/tests/030.phpt delete mode 100644 ext/uri/tests/031.phpt delete mode 100644 ext/uri/tests/033.phpt delete mode 100644 ext/uri/tests/038.phpt delete mode 100644 ext/uri/tests/039.phpt delete mode 100644 ext/uri/tests/040.phpt delete mode 100644 ext/uri/tests/041.phpt delete mode 100644 ext/uri/tests/042.phpt delete mode 100644 ext/uri/tests/043.phpt delete mode 100644 ext/uri/tests/045.phpt delete mode 100644 ext/uri/tests/046.phpt delete mode 100644 ext/uri/tests/047.phpt delete mode 100644 ext/uri/tests/049.phpt delete mode 100644 ext/uri/tests/050.phpt delete mode 100644 ext/uri/tests/051.phpt delete mode 100644 ext/uri/tests/065.phpt rename ext/uri/tests/{034.phpt => rfc3986/general/array_cast_success.phpt} (53%) create mode 100644 ext/uri/tests/rfc3986/general/clone_success.phpt create mode 100644 ext/uri/tests/rfc3986/general/constructor_error_reinitialization.phpt rename ext/uri/tests/{021.phpt => rfc3986/general/extension_error.phpt} (100%) rename ext/uri/tests/{015.phpt => rfc3986/general/instantiate_without_constructor_error.phpt} (51%) create mode 100644 ext/uri/tests/rfc3986/getters/basic_success_percent_encoded_components.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_error_unset_with_userinfo.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_ipv4_to_ipv6.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_percent_encoded_reserved.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_error_missing_host.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_success_empty_host.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_success_unset_without_host.phpt rename ext/uri/tests/{048.phpt => rfc3986/normalization/percent_encoding.phpt} (90%) create mode 100644 ext/uri/tests/rfc3986/parsing/basic_error_emoji_relative_reference_returns_null.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/basic_error_invalid_uris_return_null.phpt rename ext/uri/tests/{055.phpt => rfc3986/parsing/basic_error_relative_base.phpt} (77%) create mode 100644 ext/uri/tests/rfc3986/parsing/basic_success_constructor.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/host_error_multibyte_emoji.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/host_success_empty_network_path_reference.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/host_success_ipv4_octal_like_registered_name.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/host_success_ipvfuture_relative_reference.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/path_success_multiple_leading_slashes.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/path_success_percent_encoded.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/path_success_relative_reference_network.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/path_success_relative_reference_numeric.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/path_success_special_chars.phpt rename ext/uri/tests/{058.phpt => rfc3986/parsing/port_error_overflow.phpt} (86%) create mode 100644 ext/uri/tests/rfc3986/parsing/query_error_multibyte.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/query_error_multibyte_emoji.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/query_error_special.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/query_success_percent_encoded.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/query_success_percent_encoded_special.phpt create mode 100644 ext/uri/tests/rfc3986/parsing/query_success_plus.phpt create mode 100644 ext/uri/tests/rfc3986/reference_resolution/parse_success_absolute_with_base.phpt create mode 100644 ext/uri/tests/rfc3986/reference_resolution/parse_success_relative_with_base.phpt create mode 100644 ext/uri/tests/rfc3986/reference_resolution/resolve_error_unicode.phpt create mode 100644 ext/uri/tests/rfc3986/reference_resolution/resolve_success_absolute_uri.phpt create mode 100644 ext/uri/tests/rfc3986/reference_resolution/resolve_success_relative_reference.phpt create mode 100644 ext/uri/tests/rfc3986/serialization/basic_success.phpt rename ext/uri/tests/{032.phpt => rfc3986/serialization/json_encode_success.phpt} (52%) create mode 100644 ext/uri/tests/rfc3986/serialization/unserialize_error_invalid_data.phpt create mode 100644 ext/uri/tests/rfc3986/serialization/unserialize_error_legacy_format.phpt create mode 100644 ext/uri/tests/rfc3986/serialization/unserialize_error_reinitialization.phpt rename ext/uri/tests/{053.phpt => whatwg/exceptions/invalid_url_exception_constructor_reentry.phpt} (96%) rename ext/uri/tests/{052.phpt => whatwg/exceptions/url_validation_error_constructor_reentry.phpt} (91%) create mode 100644 ext/uri/tests/whatwg/general/array_cast_success.phpt create mode 100644 ext/uri/tests/whatwg/general/clone_success.phpt create mode 100644 ext/uri/tests/whatwg/general/constructor_error_reinitialization.phpt rename ext/uri/tests/{022.phpt => whatwg/general/extension_error.phpt} (100%) create mode 100644 ext/uri/tests/whatwg/general/instantiate_without_constructor_error.phpt rename ext/uri/tests/{056.phpt => whatwg/general/memory_management.phpt} (59%) create mode 100644 ext/uri/tests/whatwg/getters/basic_success_percent_encoded_components.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_success_ipv4_to_ipv6.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_success_file_scheme.phpt create mode 100644 ext/uri/tests/whatwg/modification/username_success_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/username_success_file_scheme.phpt create mode 100644 ext/uri/tests/whatwg/parsing/basic_error_emoji_relative_reference_returns_null.phpt create mode 100644 ext/uri/tests/whatwg/parsing/basic_success_constructor.phpt create mode 100644 ext/uri/tests/whatwg/parsing/basic_success_invalid_url_unit_warnings.phpt rename ext/uri/tests/{005.phpt => whatwg/parsing/basic_success_multibyte.phpt} (86%) rename ext/uri/tests/{057.phpt => whatwg/parsing/errors_error_typed_property_reference.phpt} (61%) create mode 100644 ext/uri/tests/whatwg/parsing/host_success_ipv4_fullwidth.phpt create mode 100644 ext/uri/tests/whatwg/parsing/host_success_ipv4_octal.phpt create mode 100644 ext/uri/tests/whatwg/parsing/host_success_ipv6_short.phpt create mode 100644 ext/uri/tests/whatwg/parsing/host_success_multibyte_emoji.phpt create mode 100644 ext/uri/tests/whatwg/parsing/path_success_file_backslash_and_spaces.phpt create mode 100644 ext/uri/tests/whatwg/parsing/path_success_multibyte_emoji.phpt create mode 100644 ext/uri/tests/whatwg/parsing/path_success_percent_encoded.phpt rename ext/uri/tests/{054.phpt => whatwg/parsing/port_error_too_large.phpt} (53%) create mode 100644 ext/uri/tests/whatwg/parsing/query_success_multibyte.phpt create mode 100644 ext/uri/tests/whatwg/parsing/query_success_multibyte_emoji.phpt create mode 100644 ext/uri/tests/whatwg/parsing/query_success_percent_encoded.phpt create mode 100644 ext/uri/tests/whatwg/parsing/query_success_percent_encoded_special.phpt create mode 100644 ext/uri/tests/whatwg/parsing/query_success_plus.phpt create mode 100644 ext/uri/tests/whatwg/parsing/query_success_special.phpt rename ext/uri/tests/{059.phpt => whatwg/parsing/scheme_success_extra_slashes.phpt} (50%) create mode 100644 ext/uri/tests/whatwg/reference_resolution/parse_success_absolute_with_base.phpt create mode 100644 ext/uri/tests/whatwg/reference_resolution/parse_success_relative_with_base.phpt create mode 100644 ext/uri/tests/whatwg/reference_resolution/resolve_error_ipv4_too_many_parts.phpt create mode 100644 ext/uri/tests/whatwg/reference_resolution/resolve_success_absolute_url.phpt create mode 100644 ext/uri/tests/whatwg/reference_resolution/resolve_success_invalid_url_unit_warnings.phpt create mode 100644 ext/uri/tests/whatwg/reference_resolution/resolve_success_relative_reference.phpt create mode 100644 ext/uri/tests/whatwg/serialization/basic_success.phpt create mode 100644 ext/uri/tests/whatwg/serialization/json_encode_success.phpt create mode 100644 ext/uri/tests/whatwg/serialization/unserialize_error_invalid_data.phpt create mode 100644 ext/uri/tests/whatwg/serialization/unserialize_error_legacy_format.phpt create mode 100644 ext/uri/tests/whatwg/serialization/unserialize_error_reinitialization.phpt rename ext/uri/tests/{101.phpt => zend/internal_api_error_whatwg_invalid_url.phpt} (67%) rename ext/uri/tests/{100.phpt => zend/internal_api_success_parse_url_parsing.phpt} (100%) rename ext/uri/tests/{102.phpt => zend/internal_api_success_rfc3986_large_port.phpt} (95%) diff --git a/ext/uri/tests/003.phpt b/ext/uri/tests/003.phpt deleted file mode 100644 index 38d62b0ec8e6..000000000000 --- a/ext/uri/tests/003.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Parse special URIs ---FILE-- - ---EXPECTF-- -NULL -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(4) "http" - ["username"]=> - string(8) "username" - ["password"]=> - string(8) "password" - ["host"]=> - string(18) "xn--hostname-b1aaa" - ["port"]=> - int(9090) - ["path"]=> - string(5) "/path" - ["query"]=> - string(14) "arg=va%C3%A9ue" - ["fragment"]=> - string(6) "anchor" -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(7) "host123" - ["port"]=> - NULL - ["path"]=> - string(1) "/" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(0) "" - ["port"]=> - NULL - ["path"]=> - string(5) "/foo/" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(7) "/page:1" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -NULL diff --git a/ext/uri/tests/004.phpt b/ext/uri/tests/004.phpt deleted file mode 100644 index c6ad96ce99a7..000000000000 --- a/ext/uri/tests/004.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -Parse invalid URLs ---FILE-- -getMessage(), "\n"; -} - -var_dump(Uri\WhatWg\Url::parse("")); - -var_dump(Uri\Rfc3986\Uri::parse("192.168/contact.html")); -var_dump(Uri\WhatWg\Url::parse("192.168/contact.html", null)); - -var_dump(Uri\Rfc3986\Uri::parse("http://RuPaul's Drag Race All Stars 7 Winners Cast on This Season's")); -var_dump(Uri\WhatWg\Url::parse("http://RuPaul's Drag Race All Stars 7 Winners Cast on This Season's", null)); - -?> ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(0) "" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(0) "" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -Uri\WhatWg\InvalidUrlException: The specified URI is malformed (MissingSchemeNonRelativeUrl) -NULL -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(20) "192.168/contact.html" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -NULL -NULL -NULL diff --git a/ext/uri/tests/006.phpt b/ext/uri/tests/006.phpt deleted file mode 100644 index e7fa79a8b837..000000000000 --- a/ext/uri/tests/006.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Test successful manual Uri child instance creation ---FILE-- - ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(5) "https" - ["username"]=> - string(8) "username" - ["password"]=> - string(8) "password" - ["host"]=> - string(11) "example.com" - ["port"]=> - int(8080) - ["path"]=> - string(5) "/path" - ["query"]=> - string(3) "q=r" - ["fragment"]=> - string(8) "fragment" -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(5) "https" - ["username"]=> - string(8) "username" - ["password"]=> - string(8) "password" - ["host"]=> - string(11) "example.com" - ["port"]=> - int(8080) - ["path"]=> - string(5) "/path" - ["query"]=> - string(3) "q=r" - ["fragment"]=> - string(8) "fragment" -} diff --git a/ext/uri/tests/007.phpt b/ext/uri/tests/007.phpt deleted file mode 100644 index 9d2f389e2513..000000000000 --- a/ext/uri/tests/007.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Test URI creation errors ---FILE-- -getMessage(), "\n"; -} - -try { - new Uri\WhatWg\Url("https://example.com:8080@username:password/path?q=r#fragment"); -} catch (Throwable $e) { - echo $e::class, ': ', $e->getMessage(), "\n"; - var_dump($e->errors); -} - -$failures = []; -$url = new Uri\WhatWg\Url(" https://example.org ", null, $failures); -var_dump($url->toAsciiString()); -var_dump($failures); - -?> ---EXPECTF-- -Uri\InvalidUriException: The specified URI is malformed -Uri\WhatWg\InvalidUrlException: The specified URI is malformed (PortInvalid) -array(%d) { - [0]=> - object(Uri\WhatWg\UrlValidationError)#%d (%d) { - ["context"]=> - string(26) "password/path?q=r#fragment" - ["type"]=> - enum(Uri\WhatWg\UrlValidationErrorType::PortInvalid) - ["failure"]=> - bool(true) - } - [1]=> - object(Uri\WhatWg\UrlValidationError)#%d (%d) { - ["context"]=> - string(36) "@username:password/path?q=r#fragment" - ["type"]=> - enum(Uri\WhatWg\UrlValidationErrorType::InvalidCredentials) - ["failure"]=> - bool(false) - } -} -string(20) "https://example.org/" -array(2) { - [0]=> - object(Uri\WhatWg\UrlValidationError)#%d (%d) { - ["context"]=> - string(1) " " - ["type"]=> - enum(Uri\WhatWg\UrlValidationErrorType::InvalidUrlUnit) - ["failure"]=> - bool(false) - } - [1]=> - object(Uri\WhatWg\UrlValidationError)#%d (%d) { - ["context"]=> - string(21) " https://example.org " - ["type"]=> - enum(Uri\WhatWg\UrlValidationErrorType::InvalidUrlUnit) - ["failure"]=> - bool(false) - } -} diff --git a/ext/uri/tests/008.phpt b/ext/uri/tests/008.phpt deleted file mode 100644 index 0a02bae63163..000000000000 --- a/ext/uri/tests/008.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -Test Uri getters ---FILE-- -getScheme()); - var_dump($uri->getRawScheme()); - var_dump($uri->getUsername()); - var_dump($uri->getRawUsername()); - var_dump($uri->getPassword()); - var_dump($uri->getRawPassword()); - var_dump($uri->getUserInfo()); - var_dump($uri->getRawUserInfo()); - var_dump($uri->getHost()); - var_dump($uri->getRawHost()); - var_dump($uri->getPort()); - var_dump($uri->getPath()); - var_dump($uri->getRawPath()); - var_dump($uri->getQuery()); - var_dump($uri->getRawQuery()); - var_dump($uri->getFragment()); - var_dump($uri->getRawFragment()); -} - -function callWhatWgGetters($url) -{ - var_dump($url->getScheme()); - var_dump($url->getUsername()); - var_dump($url->getPassword()); - var_dump($url->getAsciiHost()); - var_dump($url->getUnicodeHost()); - var_dump($url->getPort()); - var_dump($url->getPath()); - var_dump($url->getQuery()); - var_dump($url->getFragment()); -} - -$uri = Uri\Rfc3986\Uri::parse("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); -callRfc3986Getters($uri); - -echo "\n"; - -$url = Uri\WhatWg\Url::parse("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); -callWhatWgGetters($url); - -?> ---EXPECT-- -string(5) "https" -string(5) "https" -string(8) "username" -string(8) "username" -string(8) "password" -string(8) "password" -string(17) "username:password" -string(17) "username:password" -string(15) "www.example.com" -string(15) "www.example.com" -int(8080) -string(30) "/pathname1/pathname2/pathname3" -string(30) "/pathname1/pathname2/pathname3" -string(10) "query=true" -string(10) "query=true" -string(11) "hash-exists" -string(11) "hash-exists" - -string(5) "https" -string(8) "username" -string(8) "password" -string(15) "www.example.com" -string(15) "www.example.com" -int(8080) -string(30) "/pathname1/pathname2/pathname3" -string(10) "query=true" -string(11) "hash-exists" diff --git a/ext/uri/tests/009.phpt b/ext/uri/tests/009.phpt deleted file mode 100644 index 9c896d0153b2..000000000000 --- a/ext/uri/tests/009.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test parsing with IANA schemes ---FILE-- - ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(16) "chrome-extension" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(11) "example.com" - ["port"]=> - NULL - ["path"]=> - string(0) "" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(16) "chrome-extension" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(11) "example.com" - ["port"]=> - NULL - ["path"]=> - string(0) "" - ["query"]=> - NULL - ["fragment"]=> - NULL -} diff --git a/ext/uri/tests/010.phpt b/ext/uri/tests/010.phpt deleted file mode 100644 index ff5a37000775..000000000000 --- a/ext/uri/tests/010.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Test parsing URIs when a base URI is present ---FILE-- - ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(4) "http" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(11) "example.com" - ["port"]=> - NULL - ["path"]=> - string(14) "/path/to/file2" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(5) "https" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(8) "test.com" - ["port"]=> - NULL - ["path"]=> - string(14) "/path/to/file2" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(4) "http" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(11) "example.com" - ["port"]=> - NULL - ["path"]=> - string(14) "/path/to/file1" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(5) "https" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(8) "test.com" - ["port"]=> - NULL - ["path"]=> - string(14) "/path/to/file1" - ["query"]=> - NULL - ["fragment"]=> - NULL -} diff --git a/ext/uri/tests/011.phpt b/ext/uri/tests/011.phpt deleted file mode 100644 index 0e8fd8ec8f48..000000000000 --- a/ext/uri/tests/011.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test encoding and normalization ---FILE-- -toRawString()); -var_dump(Uri\Rfc3986\Uri::parse("https://www.example.com/dir1/../dir2")->toRawString()); -var_dump(Uri\Rfc3986\Uri::parse("https://你好你好")); -var_dump(Uri\Rfc3986\Uri::parse("https://0Xc0.0250.01")); -var_dump(Uri\Rfc3986\Uri::parse("HttPs://0300.0250.0000.0001/path?query=foo%20bar")->toRawString()); - -var_dump(Uri\WhatWg\Url::parse("http://////www.EXAMPLE.com:80")->toAsciiString()); -var_dump(Uri\WhatWg\Url::parse("https://www.example.com:443/dir1/../dir2")->toAsciiString()); -var_dump(Uri\WhatWg\Url::parse("https://你好你好")->toAsciiString()); -var_dump(Uri\WhatWg\Url::parse("https://你好你好")->toUnicodeString()); -var_dump(Uri\WhatWg\Url::parse("https://0Xc0.0250.01")->toAsciiString()); -var_dump(Uri\WhatWg\Url::parse("HttPs://0300.0250.0000.0001/path?query=foo%20bar")->toAsciiString()); - -?> ---EXPECT-- -string(29) "http://////www.EXAMPLE.com:80" -string(36) "https://www.example.com/dir1/../dir2" -NULL -NULL -string(48) "HttPs://0300.0250.0000.0001/path?query=foo%20bar" -string(23) "http://www.example.com/" -string(28) "https://www.example.com/dir2" -string(23) "https://xn--6qqa088eba/" -string(21) "https://你好你好/" -string(20) "https://192.168.0.1/" -string(40) "https://192.168.0.1/path?query=foo%20bar" diff --git a/ext/uri/tests/012.phpt b/ext/uri/tests/012.phpt deleted file mode 100644 index e033223a6426..000000000000 --- a/ext/uri/tests/012.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Test parsing of various schemes ---FILE-- - ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(6) "mailto" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(15) "Joe@Example.COM" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(6) "mailto" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(15) "Joe@Example.COM" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(4) "file" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(0) "" - ["port"]=> - NULL - ["path"]=> - string(30) "/E:/Documents%20and%20Settings" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(4) "file" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(0) "" - ["port"]=> - NULL - ["path"]=> - string(30) "/E:/Documents%20and%20Settings" - ["query"]=> - NULL - ["fragment"]=> - NULL -} diff --git a/ext/uri/tests/013.phpt b/ext/uri/tests/013.phpt deleted file mode 100644 index 865843ec27e8..000000000000 --- a/ext/uri/tests/013.phpt +++ /dev/null @@ -1,129 +0,0 @@ ---TEST-- -Test parsing of query strings ---FILE-- - + @")); - -var_dump(Uri\WhatWg\Url::parse("http://example.com?foobar=%27%3Cscript%3E+%2B+%40")); -var_dump(Uri\WhatWg\Url::parse("http://example.com?foobar='