From 059b1a1bab87e07cd75f650fb12df4e6287a3671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Fri, 12 Sep 2025 08:14:09 +0200 Subject: [PATCH 1/5] Reorganize ext/uri tests - withers --- .../modification/fragment_error_reserved.phpt | 18 +++++++++++++++ .../modification/fragment_error_unicode.phpt | 18 +++++++++++++++ .../modification/fragment_success_empty.phpt | 19 ++++++++++++++++ .../fragment_success_encoded.phpt | 20 +++++++++++++++++ .../fragment_success_existing.phpt | 19 ++++++++++++++++ .../fragment_success_unset_existing.phpt | 19 ++++++++++++++++ .../fragment_success_unset_non_existent.phpt | 19 ++++++++++++++++ .../modification/host_error_reserved.phpt | 18 +++++++++++++++ .../modification/host_success_empty.phpt | 19 ++++++++++++++++ .../modification/host_success_encoded.phpt | 19 ++++++++++++++++ .../modification/host_success_existing.phpt | 19 ++++++++++++++++ .../modification/host_success_ipv4.phpt | 19 ++++++++++++++++ .../modification/host_success_ipv6.phpt | 19 ++++++++++++++++ .../modification/host_success_new.phpt | 19 ++++++++++++++++ .../host_success_unset_existing.phpt | 19 ++++++++++++++++ .../host_success_unset_non_existent.phpt | 19 ++++++++++++++++ .../modification/path_error_reserved.phpt | 18 +++++++++++++++ .../modification/path_error_unicode.phpt | 18 +++++++++++++++ .../path_error_without_leading_slash.phpt | 18 +++++++++++++++ .../modification/path_success_email.phpt | 19 ++++++++++++++++ .../modification/path_success_empty.phpt | 19 ++++++++++++++++ .../modification/path_success_encoded.phpt | 19 ++++++++++++++++ .../modification/path_success_existing.phpt | 19 ++++++++++++++++ .../modification/port_error_negative.phpt | 18 +++++++++++++++ .../modification/port_error_overflow.phpt | 22 +++++++++++++++++++ .../modification/port_success_existing.phpt | 17 ++++++++++++++ .../modification/port_success_new.phpt | 17 ++++++++++++++ .../port_success_unset_existing.phpt | 17 ++++++++++++++ .../port_success_unset_non_existent.phpt | 17 ++++++++++++++ .../modification/query_error_reserved.phpt | 18 +++++++++++++++ .../modification/query_error_unicode.phpt | 18 +++++++++++++++ ...ery_success_context_senstive_reserved.phpt | 19 ++++++++++++++++ .../modification/query_success_empty.phpt | 19 ++++++++++++++++ .../modification/query_success_encoded.phpt | 20 +++++++++++++++++ .../modification/query_success_existing.phpt | 19 ++++++++++++++++ .../query_success_unset_existing.phpt | 19 ++++++++++++++++ .../query_success_unset_non_existent.phpt | 19 ++++++++++++++++ .../modification/roundtrip_special_case1.phpt | 20 +++++++++++++++++ .../modification/roundtrip_special_case2.phpt | 20 +++++++++++++++++ .../modification/roundtrip_special_case3.phpt | 20 +++++++++++++++++ .../modification/scheme_error_empty.phpt | 19 ++++++++++++++++ .../modification/scheme_error_encoded.phpt | 18 +++++++++++++++ .../modification/scheme_error_reserved.phpt | 18 +++++++++++++++ .../modification/scheme_success_basic.phpt | 19 ++++++++++++++++ .../scheme_success_unset_existing.phpt | 19 ++++++++++++++++ .../scheme_success_unset_non_existent.phpt | 19 ++++++++++++++++ .../modification/userinfo_error_reserved.phpt | 18 +++++++++++++++ .../modification/userinfo_success_empty.phpt | 19 ++++++++++++++++ .../userinfo_success_encoded.phpt | 19 ++++++++++++++++ .../userinfo_success_existing.phpt | 19 ++++++++++++++++ .../modification/userinfo_success_new.phpt | 19 ++++++++++++++++ .../userinfo_success_unset_existing.phpt | 19 ++++++++++++++++ .../userinfo_success_unset_non_existent.phpt | 19 ++++++++++++++++ .../fragment_success_auto_encode.phpt | 17 ++++++++++++++ .../modification/fragment_success_empty.phpt | 17 ++++++++++++++ .../fragment_success_encoded.phpt | 17 ++++++++++++++ .../fragment_success_existing.phpt | 17 ++++++++++++++ .../fragment_success_unicode.phpt | 17 ++++++++++++++ .../fragment_success_unset_existing.phpt | 17 ++++++++++++++ .../fragment_success_unset_non_existent.phpt | 17 ++++++++++++++ ...ragment_success_with_leading_hashmark.phpt | 17 ++++++++++++++ .../whatwg/modification/host_error_empty.phpt | 18 +++++++++++++++ ...rror_forbidden_host_codepoint_opaque1.phpt | 18 +++++++++++++++ ...rror_forbidden_host_codepoint_opaque2.phpt | 17 ++++++++++++++ ...rror_forbidden_host_codepoint_opaque3.phpt | 18 +++++++++++++++ ...ror_forbidden_host_codepoint_special1.phpt | 18 +++++++++++++++ ...ror_forbidden_host_codepoint_special2.phpt | 18 +++++++++++++++ .../host_error_unset_existing.phpt | 18 +++++++++++++++ .../modification/host_success_encoded.phpt | 17 ++++++++++++++ .../modification/host_success_existing.phpt | 17 ++++++++++++++ .../modification/host_success_idna.phpt | 19 ++++++++++++++++ .../modification/host_success_ipv4.phpt | 17 ++++++++++++++ .../modification/host_success_ipv6.phpt | 17 ++++++++++++++ .../password_success_auto_encoded.phpt | 17 ++++++++++++++ .../password_success_encoded.phpt | 17 ++++++++++++++ .../password_success_existing.phpt | 17 ++++++++++++++ .../modification/password_success_new.phpt | 17 ++++++++++++++ .../password_success_unset_existing.phpt | 17 ++++++++++++++ .../password_success_unset_non_existent.phpt | 17 ++++++++++++++ .../path_success_auto_encoded.phpt | 17 ++++++++++++++ .../modification/path_success_empty.phpt | 17 ++++++++++++++ .../modification/path_success_encoded.phpt | 17 ++++++++++++++ .../modification/path_success_existing.phpt | 17 ++++++++++++++ .../modification/path_success_unicode.phpt | 16 ++++++++++++++ .../path_success_without_leading_slash.phpt | 17 ++++++++++++++ .../modification/port_error_negative.phpt | 18 +++++++++++++++ .../modification/port_error_overflow.phpt | 22 +++++++++++++++++++ .../modification/port_error_too_large.phpt | 18 +++++++++++++++ .../modification/port_success_existing.phpt | 17 ++++++++++++++ .../whatwg/modification/port_success_new.phpt | 17 ++++++++++++++ .../port_success_unset_existing.phpt | 17 ++++++++++++++ .../port_success_unset_non_existent.phpt | 17 ++++++++++++++ .../query_success_auto_encoded.phpt | 17 ++++++++++++++ ...ry_success_context_senstivie_reserved.phpt | 17 ++++++++++++++ .../modification/query_success_empty.phpt | 17 ++++++++++++++ .../modification/query_success_encoded.phpt | 17 ++++++++++++++ .../modification/query_success_existing.phpt | 17 ++++++++++++++ .../modification/query_success_unicode.phpt | 17 ++++++++++++++ .../query_success_unset_existing.phpt | 17 ++++++++++++++ .../query_success_unset_non_existent.phpt | 17 ++++++++++++++ ...ry_success_with_leading_question_mark.phpt | 17 ++++++++++++++ .../modification/scheme_error_empty.phpt | 18 +++++++++++++++ .../modification/scheme_error_encoded.phpt | 18 +++++++++++++++ .../modification/scheme_error_invalid.phpt | 18 +++++++++++++++ .../modification/scheme_success_basic.phpt | 17 ++++++++++++++ .../modification/scheme_success_colon.phpt | 17 ++++++++++++++ .../modification/scheme_success_full.phpt | 17 ++++++++++++++ .../username_success_auto_encoded.phpt | 17 ++++++++++++++ .../username_success_existing.phpt | 17 ++++++++++++++ .../modification/username_success_new.phpt | 17 ++++++++++++++ .../username_success_unset_existing.phpt | 17 ++++++++++++++ .../username_success_unset_non_existent.phpt | 17 ++++++++++++++ 112 files changed, 2015 insertions(+) create mode 100644 ext/uri/tests/rfc3986/modification/fragment_error_reserved.phpt create mode 100644 ext/uri/tests/rfc3986/modification/fragment_error_unicode.phpt create mode 100644 ext/uri/tests/rfc3986/modification/fragment_success_empty.phpt create mode 100644 ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt create mode 100644 ext/uri/tests/rfc3986/modification/fragment_success_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/fragment_success_unset_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/fragment_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_error_reserved.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_empty.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_encoded.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_ipv4.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_new.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_unset_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/host_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/rfc3986/modification/path_error_reserved.phpt create mode 100644 ext/uri/tests/rfc3986/modification/path_error_unicode.phpt create mode 100644 ext/uri/tests/rfc3986/modification/path_error_without_leading_slash.phpt create mode 100644 ext/uri/tests/rfc3986/modification/path_success_email.phpt create mode 100644 ext/uri/tests/rfc3986/modification/path_success_empty.phpt create mode 100644 ext/uri/tests/rfc3986/modification/path_success_encoded.phpt create mode 100644 ext/uri/tests/rfc3986/modification/path_success_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_error_negative.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_error_overflow.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_success_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_success_new.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_success_unset_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/port_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/rfc3986/modification/query_error_reserved.phpt create mode 100644 ext/uri/tests/rfc3986/modification/query_error_unicode.phpt create mode 100644 ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt create mode 100644 ext/uri/tests/rfc3986/modification/query_success_empty.phpt create mode 100644 ext/uri/tests/rfc3986/modification/query_success_encoded.phpt create mode 100644 ext/uri/tests/rfc3986/modification/query_success_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/query_success_unset_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/query_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/rfc3986/modification/roundtrip_special_case1.phpt create mode 100644 ext/uri/tests/rfc3986/modification/roundtrip_special_case2.phpt create mode 100644 ext/uri/tests/rfc3986/modification/roundtrip_special_case3.phpt create mode 100644 ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt create mode 100644 ext/uri/tests/rfc3986/modification/scheme_error_encoded.phpt create mode 100644 ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt create mode 100644 ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt create mode 100644 ext/uri/tests/rfc3986/modification/scheme_success_unset_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/scheme_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/rfc3986/modification/userinfo_error_reserved.phpt create mode 100644 ext/uri/tests/rfc3986/modification/userinfo_success_empty.phpt create mode 100644 ext/uri/tests/rfc3986/modification/userinfo_success_encoded.phpt create mode 100644 ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt create mode 100644 ext/uri/tests/rfc3986/modification/userinfo_success_unset_existing.phpt create mode 100644 ext/uri/tests/rfc3986/modification/userinfo_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/whatwg/modification/fragment_success_auto_encode.phpt create mode 100644 ext/uri/tests/whatwg/modification/fragment_success_empty.phpt create mode 100644 ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/fragment_success_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/fragment_success_unicode.phpt create mode 100644 ext/uri/tests/whatwg/modification/fragment_success_unset_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/fragment_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/whatwg/modification/fragment_success_with_leading_hashmark.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_error_empty.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque1.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque2.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque3.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special1.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special2.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_error_unset_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_success_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_success_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_success_idna.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_success_ipv4.phpt create mode 100644 ext/uri/tests/whatwg/modification/host_success_ipv6.phpt create mode 100644 ext/uri/tests/whatwg/modification/password_success_auto_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/password_success_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/password_success_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/password_success_new.phpt create mode 100644 ext/uri/tests/whatwg/modification/password_success_unset_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/password_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/whatwg/modification/path_success_auto_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/path_success_empty.phpt create mode 100644 ext/uri/tests/whatwg/modification/path_success_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/path_success_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/path_success_unicode.phpt create mode 100644 ext/uri/tests/whatwg/modification/path_success_without_leading_slash.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_error_negative.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_error_overflow.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_error_too_large.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_success_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_success_new.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_success_unset_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_auto_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_context_senstivie_reserved.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_empty.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_unicode.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_unset_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_unset_non_existent.phpt create mode 100644 ext/uri/tests/whatwg/modification/query_success_with_leading_question_mark.phpt create mode 100644 ext/uri/tests/whatwg/modification/scheme_error_empty.phpt create mode 100644 ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt create mode 100644 ext/uri/tests/whatwg/modification/scheme_success_basic.phpt create mode 100644 ext/uri/tests/whatwg/modification/scheme_success_colon.phpt create mode 100644 ext/uri/tests/whatwg/modification/scheme_success_full.phpt create mode 100644 ext/uri/tests/whatwg/modification/username_success_auto_encoded.phpt create mode 100644 ext/uri/tests/whatwg/modification/username_success_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/username_success_new.phpt create mode 100644 ext/uri/tests/whatwg/modification/username_success_unset_existing.phpt create mode 100644 ext/uri/tests/whatwg/modification/username_success_unset_non_existent.phpt diff --git a/ext/uri/tests/rfc3986/modification/fragment_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/fragment_error_reserved.phpt new file mode 100644 index 0000000000000..4b3c3dd00a99e --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/fragment_error_reserved.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - fragment - reserved characters +--EXTENSIONS-- +uri +--FILE-- +withFragment("#fragment"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified fragment is malformed diff --git a/ext/uri/tests/rfc3986/modification/fragment_error_unicode.phpt b/ext/uri/tests/rfc3986/modification/fragment_error_unicode.phpt new file mode 100644 index 0000000000000..bbb1e2ffe8727 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/fragment_error_unicode.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - fragment - unicode characters +--EXTENSIONS-- +uri +--FILE-- +withFragment("ő"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified fragment is malformed diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_empty.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_empty.phpt new file mode 100644 index 0000000000000..bf29384ec57e3 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/fragment_success_empty.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - fragment - empty string +--EXTENSIONS-- +uri +--FILE-- +withFragment(""); + +var_dump($uri1->getRawFragment()); +var_dump($uri2->getRawFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +string(0) "" +string(0) "" diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt new file mode 100644 index 0000000000000..f2e420e2c85bd --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - fragment - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withFragment("foo%3Dbar"); // foo=bar + +var_dump($uri1->getRawFragment()); +var_dump($uri2->getRawFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +string(9) "foo%3Dbar" +string(9) "foo%3Dbar" + diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_existing.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_existing.phpt new file mode 100644 index 0000000000000..8690c5e36f2a1 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/fragment_success_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - fragment - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withFragment("bar"); + +var_dump($uri1->getRawFragment()); +var_dump($uri2->getRawFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +string(3) "foo" +string(3) "bar" +string(3) "bar" diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_unset_existing.phpt new file mode 100644 index 0000000000000..b6014ac021af7 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/fragment_success_unset_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - fragment - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withFragment(null); + +var_dump($uri1->getRawFragment()); +var_dump($uri2->getRawFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +string(3) "foo" +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..6542c62a4ac01 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/fragment_success_unset_non_existent.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - fragment - unsetting not-existent +--EXTENSIONS-- +uri +--FILE-- +withFragment(null); + +var_dump($uri1->getRawFragment()); +var_dump($uri2->getRawFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/host_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/host_error_reserved.phpt new file mode 100644 index 0000000000000..81d60bc2e400b --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_error_reserved.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - reserved characters +--EXTENSIONS-- +uri +--FILE-- +withHost("ex#mple.com"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified host is malformed diff --git a/ext/uri/tests/rfc3986/modification/host_success_empty.phpt b/ext/uri/tests/rfc3986/modification/host_success_empty.phpt new file mode 100644 index 0000000000000..0a51a6681a1f1 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_empty.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - empty string +--EXTENSIONS-- +uri +--FILE-- +withHost(""); + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(0) "" +string(0) "" diff --git a/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt new file mode 100644 index 0000000000000..2b71caf85df41 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withHost("t%65st.com"); // test.com + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(10) "t%65st.com" +string(8) "test.com" diff --git a/ext/uri/tests/rfc3986/modification/host_success_existing.phpt b/ext/uri/tests/rfc3986/modification/host_success_existing.phpt new file mode 100644 index 0000000000000..7a1dbd94b9bd5 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withHost("test.com"); + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(8) "test.com" +string(8) "test.com" diff --git a/ext/uri/tests/rfc3986/modification/host_success_ipv4.phpt b/ext/uri/tests/rfc3986/modification/host_success_ipv4.phpt new file mode 100644 index 0000000000000..6c69b2410e42d --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_ipv4.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - IPv4 address +--EXTENSIONS-- +uri +--FILE-- +withHost("192.168.0.1"); + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(11) "192.168.0.1" +string(11) "192.168.0.1" diff --git a/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt b/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt new file mode 100644 index 0000000000000..afd5bbae45cc0 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - IPv6 address +--EXTENSIONS-- +uri +--FILE-- +withHost("[2001:db8:3333:4444:5555:6666:7777:8888]"); + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" +string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" diff --git a/ext/uri/tests/rfc3986/modification/host_success_new.phpt b/ext/uri/tests/rfc3986/modification/host_success_new.phpt new file mode 100644 index 0000000000000..a8903324df25c --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_new.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - adding a new one +--EXTENSIONS-- +uri +--FILE-- +withHost("example.com"); + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +NULL +string(11) "example.com" +string(11) "example.com" diff --git a/ext/uri/tests/rfc3986/modification/host_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/host_success_unset_existing.phpt new file mode 100644 index 0000000000000..1afc0f07f9241 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_unset_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withHost(null); + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +string(11) "example.com" +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/host_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/host_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..da6cff9fbe473 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_unset_non_existent.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - unsetting non-existent +--EXTENSIONS-- +uri +--FILE-- +withHost(null); + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +NULL +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt new file mode 100644 index 0000000000000..9f794ec41e922 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - path - reserved characters +--EXTENSIONS-- +uri +--FILE-- +withPath("@foo"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified path is malformed diff --git a/ext/uri/tests/rfc3986/modification/path_error_unicode.phpt b/ext/uri/tests/rfc3986/modification/path_error_unicode.phpt new file mode 100644 index 0000000000000..9335132dad56c --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/path_error_unicode.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - path - unicode characters +--EXTENSIONS-- +uri +--FILE-- +withPath("/ő"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified path is malformed diff --git a/ext/uri/tests/rfc3986/modification/path_error_without_leading_slash.phpt b/ext/uri/tests/rfc3986/modification/path_error_without_leading_slash.phpt new file mode 100644 index 0000000000000..476e4ec873c28 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/path_error_without_leading_slash.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - path - without leading slash +--EXTENSIONS-- +uri +--FILE-- +withPath("foo"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified path is malformed diff --git a/ext/uri/tests/rfc3986/modification/path_success_email.phpt b/ext/uri/tests/rfc3986/modification/path_success_email.phpt new file mode 100644 index 0000000000000..a3b3eba31bab6 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/path_success_email.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - path - using an email format +--EXTENSIONS-- +uri +--FILE-- +withPath("john.doe@example.com"); + +var_dump($uri1->getRawPath()); +var_dump($uri2->getRawPath()); +var_dump($uri2->getPath()); + +?> +--EXPECT-- +string(0) "" +string(20) "john.doe@example.com" +string(20) "john.doe@example.com" diff --git a/ext/uri/tests/rfc3986/modification/path_success_empty.phpt b/ext/uri/tests/rfc3986/modification/path_success_empty.phpt new file mode 100644 index 0000000000000..b1854d5f3c4da --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/path_success_empty.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - path - empty string +--EXTENSIONS-- +uri +--FILE-- +withPath(""); + +var_dump($uri1->getRawPath()); +var_dump($uri2->getRawPath()); +var_dump($uri2->getPath()); + +?> +--EXPECT-- +string(0) "" +string(0) "" +string(0) "" diff --git a/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt new file mode 100644 index 0000000000000..833271733fd88 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - path - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withPath("/foo%2Fbar"); // /foo/bar + +var_dump($uri1->getRawPath()); +var_dump($uri2->getRawPath()); +var_dump($uri2->getPath()); + +?> +--EXPECT-- +string(0) "" +string(10) "/foo%2Fbar" +string(10) "/foo%2Fbar" diff --git a/ext/uri/tests/rfc3986/modification/path_success_existing.phpt b/ext/uri/tests/rfc3986/modification/path_success_existing.phpt new file mode 100644 index 0000000000000..17f1a0c0183ad --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/path_success_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - path - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withPath("/baz"); + +var_dump($uri1->getRawPath()); +var_dump($uri2->getRawPath()); +var_dump($uri2->getPath()); + +?> +--EXPECT-- +string(8) "/foo/bar" +string(4) "/baz" +string(4) "/baz" diff --git a/ext/uri/tests/rfc3986/modification/port_error_negative.phpt b/ext/uri/tests/rfc3986/modification/port_error_negative.phpt new file mode 100644 index 0000000000000..598475b1e1845 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/port_error_negative.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - too small number +--EXTENSIONS-- +uri +--FILE-- +withPort(-1); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified port is malformed diff --git a/ext/uri/tests/rfc3986/modification/port_error_overflow.phpt b/ext/uri/tests/rfc3986/modification/port_error_overflow.phpt new file mode 100644 index 0000000000000..05651874fa501 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/port_error_overflow.phpt @@ -0,0 +1,22 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - port - too large port numbers don't overflow +--EXTENSIONS-- +uri +--FILE-- +withPort(9223372036854775808); + } else { + $uri->withPort(2147483648); + } +} catch (TypeError $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +Uri\Rfc3986\Uri::withPort(): Argument #1 ($port) must be of type ?int, float given diff --git a/ext/uri/tests/rfc3986/modification/port_success_existing.phpt b/ext/uri/tests/rfc3986/modification/port_success_existing.phpt new file mode 100644 index 0000000000000..c777c7f7d29bb --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/port_success_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - port - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withPort(433); + +var_dump($uri1->getPort()); +var_dump($uri2->getPort()); + +?> +--EXPECT-- +int(80) +int(433) diff --git a/ext/uri/tests/rfc3986/modification/port_success_new.phpt b/ext/uri/tests/rfc3986/modification/port_success_new.phpt new file mode 100644 index 0000000000000..c12a194bc3307 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/port_success_new.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - port - adding a new one +--EXTENSIONS-- +uri +--FILE-- +withPort(433); + +var_dump($uri1->getPort()); +var_dump($uri2->getPort()); + +?> +--EXPECT-- +NULL +int(433) diff --git a/ext/uri/tests/rfc3986/modification/port_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/port_success_unset_existing.phpt new file mode 100644 index 0000000000000..301b2070f4e9f --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/port_success_unset_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - port - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withPort(null); + +var_dump($uri1->getPort()); +var_dump($uri2->getPort()); + +?> +--EXPECT-- +int(80) +NULL diff --git a/ext/uri/tests/rfc3986/modification/port_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/port_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..101718f64b066 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/port_success_unset_non_existent.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - port - unsetting non-existent +--EXTENSIONS-- +uri +--FILE-- +withPort(null); + +var_dump($uri2->getPort()); +var_dump($uri2->getPort()); + +?> +--EXPECT-- +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/query_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/query_error_reserved.phpt new file mode 100644 index 0000000000000..f09e867a0210f --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/query_error_reserved.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - query - reserved characters +--EXTENSIONS-- +uri +--FILE-- +withQuery("#foo"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified query is malformed diff --git a/ext/uri/tests/rfc3986/modification/query_error_unicode.phpt b/ext/uri/tests/rfc3986/modification/query_error_unicode.phpt new file mode 100644 index 0000000000000..c8f5100597429 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/query_error_unicode.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - query - unicode characters +--EXTENSIONS-- +uri +--FILE-- +withQuery("ő"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified query is malformed diff --git a/ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt b/ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt new file mode 100644 index 0000000000000..9edfbf333c2f0 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - query - context-sensitive reserved character +--EXTENSIONS-- +uri +--FILE-- +withQuery("?foo=bar"); + +var_dump($uri1->getRawQuery()); +var_dump($uri2->getRawQuery()); +var_dump($uri2->getQuery()); + +?> +--EXPECT-- +NULL +string(8) "?foo=bar" +string(8) "?foo=bar" diff --git a/ext/uri/tests/rfc3986/modification/query_success_empty.phpt b/ext/uri/tests/rfc3986/modification/query_success_empty.phpt new file mode 100644 index 0000000000000..d6a728b6d6c44 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/query_success_empty.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - query - empty string +--EXTENSIONS-- +uri +--FILE-- +withQuery(""); + +var_dump($uri1->getRawQuery()); +var_dump($uri2->getRawQuery()); +var_dump($uri2->getQuery()); + +?> +--EXPECT-- +NULL +string(0) "" +string(0) "" diff --git a/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt new file mode 100644 index 0000000000000..207c7d6523ddd --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - query - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withQuery("foo%3Dbar"); // foo=bar + +var_dump($uri1->getRawQuery()); +var_dump($uri2->getRawQuery()); +var_dump($uri2->getQuery()); + +?> +--EXPECT-- +NULL +string(9) "foo%3Dbar" +string(9) "foo%3Dbar" + diff --git a/ext/uri/tests/rfc3986/modification/query_success_existing.phpt b/ext/uri/tests/rfc3986/modification/query_success_existing.phpt new file mode 100644 index 0000000000000..459f135fa5e3b --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/query_success_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - query - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withQuery("foo=bar&baz=qux"); + +var_dump($uri1->getRawQuery()); +var_dump($uri2->getRawQuery()); +var_dump($uri2->getQuery()); + +?> +--EXPECT-- +string(7) "foo=bar" +string(15) "foo=bar&baz=qux" +string(15) "foo=bar&baz=qux" diff --git a/ext/uri/tests/rfc3986/modification/query_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/query_success_unset_existing.phpt new file mode 100644 index 0000000000000..61b4a0fbdc5cf --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/query_success_unset_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - query - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withQuery(null); + +var_dump($uri1->getRawQuery()); +var_dump($uri2->getRawQuery()); +var_dump($uri2->getQuery()); + +?> +--EXPECT-- +string(7) "foo=bar" +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/query_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/query_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..0290b5bf77cd2 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/query_success_unset_non_existent.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - query - unsetting not-existent +--EXTENSIONS-- +uri +--FILE-- +withQuery(null); + +var_dump($uri1->getRawQuery()); +var_dump($uri2->getRawQuery()); +var_dump($uri2->getQuery()); + +?> +--EXPECT-- +NULL +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/roundtrip_special_case1.phpt b/ext/uri/tests/rfc3986/modification/roundtrip_special_case1.phpt new file mode 100644 index 0000000000000..c7f2dba8508ae --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/roundtrip_special_case1.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification when roundtripping is not guaranteed - case 1 +--EXTENSIONS-- +uri +--FILE-- +withHost("host"); +$uri2 = $uri2->withHost(null); + +var_dump($uri1->getRawPath()); +var_dump($uri2->getRawPath()); +var_dump($uri2->getPath()); + +?> +--EXPECT-- +string(5) "path1" +string(6) "/path1" +string(6) "/path1" diff --git a/ext/uri/tests/rfc3986/modification/roundtrip_special_case2.phpt b/ext/uri/tests/rfc3986/modification/roundtrip_special_case2.phpt new file mode 100644 index 0000000000000..624abf2fc49ca --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/roundtrip_special_case2.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification when roundtripping is not guaranteed - case 2 +--EXTENSIONS-- +uri +--FILE-- +withScheme(null); +$uri2 = $uri2->withScheme("scheme"); + +var_dump($uri1->toRawString()); +var_dump($uri2->toRawString()); +var_dump($uri2->toString()); + +?> +--EXPECT-- +string(13) "scheme:path1:" +string(15) "scheme:./path1:" +string(13) "scheme:path1:" diff --git a/ext/uri/tests/rfc3986/modification/roundtrip_special_case3.phpt b/ext/uri/tests/rfc3986/modification/roundtrip_special_case3.phpt new file mode 100644 index 0000000000000..7d6e1e4d0489b --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/roundtrip_special_case3.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification when roundtripping is not guaranteed - case 3 +--EXTENSIONS-- +uri +--FILE-- +withHost(null); +$uri2 = $uri2->withHost("host"); + +var_dump($uri1->toRawString()); +var_dump($uri2->toRawString()); +var_dump($uri2->toString()); + +?> +--EXPECT-- +string(12) "//host//path" +string(14) "//host/.//path" +string(12) "//host//path" diff --git a/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt b/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt new file mode 100644 index 0000000000000..c73c40d050b28 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - scheme - empty string +--EXTENSIONS-- +uri +--FILE-- +withScheme(""); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified scheme is malformed + diff --git a/ext/uri/tests/rfc3986/modification/scheme_error_encoded.phpt b/ext/uri/tests/rfc3986/modification/scheme_error_encoded.phpt new file mode 100644 index 0000000000000..683f46cc42a83 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/scheme_error_encoded.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - scheme - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withScheme("http%73"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified scheme is malformed diff --git a/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt new file mode 100644 index 0000000000000..f786ef1b67e81 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - scheme - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withScheme("https:"); +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified scheme is malformed diff --git a/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt b/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt new file mode 100644 index 0000000000000..ded5981c713fd --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - scheme - basic case +--EXTENSIONS-- +uri +--FILE-- +withScheme("http"); + +var_dump($uri1->getRawScheme()); +var_dump($uri2->getRawScheme()); +var_dump($uri2->getScheme()); + +?> +--EXPECT-- +string(5) "https" +string(4) "http" +string(4) "http" diff --git a/ext/uri/tests/rfc3986/modification/scheme_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/scheme_success_unset_existing.phpt new file mode 100644 index 0000000000000..a5e1cfae75413 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/scheme_success_unset_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - scheme - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withScheme(null); + +var_dump($uri1->getRawScheme()); +var_dump($uri2->getRawScheme()); +var_dump($uri2->getScheme()); + +?> +--EXPECT-- +string(5) "https" +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/scheme_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/scheme_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..030ae9bd2941b --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/scheme_success_unset_non_existent.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - scheme - unsetting non-existent +--EXTENSIONS-- +uri +--FILE-- +withScheme(null); + +var_dump($uri1->getRawScheme()); +var_dump($uri2->getRawScheme()); +var_dump($uri2->getScheme()); + +?> +--EXPECT-- +NULL +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/userinfo_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/userinfo_error_reserved.phpt new file mode 100644 index 0000000000000..a5f820b0d59f1 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/userinfo_error_reserved.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - userinfo - reserved characters +--EXTENSIONS-- +uri +--FILE-- +withUserInfo("us/r:password"); // us/r:password +} catch (Uri\InvalidUriException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified userinfo is malformed diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_empty.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_empty.phpt new file mode 100644 index 0000000000000..ab753e6de507a --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_empty.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - userinfo - empty string +--EXTENSIONS-- +uri +--FILE-- +withUserInfo(""); + +var_dump($uri1->getRawUserInfo()); +var_dump($uri2->getRawUserInfo()); +var_dump($uri2->getUserInfo()); + +?> +--EXPECT-- +NULL +string(0) "" +string(0) "" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_encoded.phpt new file mode 100644 index 0000000000000..1237efb21e1fb --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_encoded.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - userinfo - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withUserInfo("%75s%2Fr:password"); // us/r:password + +var_dump($uri1->getRawUserInfo()); +var_dump($uri2->getRawUserInfo()); +var_dump($uri2->getUserInfo()); + +?> +--EXPECT-- +NULL +string(17) "%75s%2Fr:password" +string(15) "us%2Fr:password" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt new file mode 100644 index 0000000000000..2c35cc4c3ce06 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri omponent modification - userinfo - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withUserInfo("user:password"); + +var_dump($uri1->getRawUserInfo()); +var_dump($uri2->getRawUserInfo()); +var_dump($uri2->getUserInfo()); + +?> +--EXPECT-- +NULL +string(13) "user:password" +string(13) "user:password" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt new file mode 100644 index 0000000000000..397ae5dd2cb7c --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - userinfo - adding a new one +--EXTENSIONS-- +uri +--FILE-- +withUserInfo("user:password"); + +var_dump($uri1->getRawUserInfo()); +var_dump($uri2->getRawUserInfo()); +var_dump($uri2->getUserInfo()); + +?> +--EXPECT-- +string(5) ":pass" +string(13) "user:password" +string(13) "user:password" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_unset_existing.phpt new file mode 100644 index 0000000000000..cc4ccc5687564 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_unset_existing.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - userinfo - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withUserInfo(null); + +var_dump($uri1->getRawUserInfo()); +var_dump($uri2->getRawUserInfo()); +var_dump($uri2->getUserInfo()); + +?> +--EXPECT-- +string(13) "user:password" +NULL +NULL diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..8c06b667b8bc8 --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_unset_non_existent.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - userinfo - unsetting non-existent +--EXTENSIONS-- +uri +--FILE-- +withUserInfo(null); + +var_dump($uri1->getRawUserInfo()); +var_dump($uri2->getRawUserInfo()); +var_dump($uri2->getUserInfo()); + +?> +--EXPECT-- +NULL +NULL +NULL diff --git a/ext/uri/tests/whatwg/modification/fragment_success_auto_encode.phpt b/ext/uri/tests/whatwg/modification/fragment_success_auto_encode.phpt new file mode 100644 index 0000000000000..cfa4831ea91e3 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/fragment_success_auto_encode.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - fragment - characters from the percent encode set +--EXTENSIONS-- +uri +--FILE-- +withFragment("<>"); + +var_dump($uri1->getFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +string(6) "%3C%3E" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_empty.phpt b/ext/uri/tests/whatwg/modification/fragment_success_empty.phpt new file mode 100644 index 0000000000000..9d068f8f9375f --- /dev/null +++ b/ext/uri/tests/whatwg/modification/fragment_success_empty.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - fragment - empty string +--EXTENSIONS-- +uri +--FILE-- +withFragment(""); + +var_dump($uri1->getFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +NULL diff --git a/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt b/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt new file mode 100644 index 0000000000000..33f8317b249a2 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - fragment - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withFragment("foo%3Dbar"); // foo=bar + +var_dump($uri1->getFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +string(9) "foo%3Dbar" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_existing.phpt b/ext/uri/tests/whatwg/modification/fragment_success_existing.phpt new file mode 100644 index 0000000000000..31f20ce70b0e2 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/fragment_success_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - fragment - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withFragment("bar"); + +var_dump($uri1->getFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +string(3) "foo" +string(3) "bar" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_unicode.phpt b/ext/uri/tests/whatwg/modification/fragment_success_unicode.phpt new file mode 100644 index 0000000000000..06575390100e3 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/fragment_success_unicode.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - fragment - unicode characters +--EXTENSIONS-- +uri +--FILE-- +withFragment("ő"); + +var_dump($uri1->getFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +string(6) "%C5%91" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/fragment_success_unset_existing.phpt new file mode 100644 index 0000000000000..9a920f8b1feed --- /dev/null +++ b/ext/uri/tests/whatwg/modification/fragment_success_unset_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - fragment - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withFragment(null); + +var_dump($uri1->getFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +string(3) "foo" +NULL diff --git a/ext/uri/tests/whatwg/modification/fragment_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/fragment_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..e159af5e8fea4 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/fragment_success_unset_non_existent.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - fragment - unsetting not-existent +--EXTENSIONS-- +uri +--FILE-- +withFragment(null); + +var_dump($uri1->getFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +NULL diff --git a/ext/uri/tests/whatwg/modification/fragment_success_with_leading_hashmark.phpt b/ext/uri/tests/whatwg/modification/fragment_success_with_leading_hashmark.phpt new file mode 100644 index 0000000000000..540014ee47406 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/fragment_success_with_leading_hashmark.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - fragment - with leading hashmark +--EXTENSIONS-- +uri +--FILE-- +withFragment("#fragment"); + +var_dump($uri1->getFragment()); +var_dump($uri2->getFragment()); + +?> +--EXPECT-- +NULL +string(8) "fragment" diff --git a/ext/uri/tests/whatwg/modification/host_error_empty.phpt b/ext/uri/tests/whatwg/modification/host_error_empty.phpt new file mode 100644 index 0000000000000..f9f4739578604 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_error_empty.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - empty string +--EXTENSIONS-- +uri +--FILE-- +withHost(""); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified host is malformed (HostMissing) diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque1.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque1.phpt new file mode 100644 index 0000000000000..8aebc5f7057df --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque1.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - forbidden host code point +--EXTENSIONS-- +uri +--FILE-- +withHost("ex@mple.com"); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified host is malformed (HostInvalidCodePoint) diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque2.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque2.phpt new file mode 100644 index 0000000000000..6d8b0c8b6565e --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque2.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - forbidden host code point +--EXTENSIONS-- +uri +--FILE-- +withHost("ex#mple.com"); + +var_dump($url1->getAsciiHost()); +var_dump($url2->getAsciiHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(2) "ex" diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque3.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque3.phpt new file mode 100644 index 0000000000000..940d4c9db73a1 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque3.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - forbidden host codepoint +--EXTENSIONS-- +uri +--FILE-- +withHost("ex:mple.com"); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified host is malformed diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special1.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special1.phpt new file mode 100644 index 0000000000000..a27c26381b4e5 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special1.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - forbidden domain code point +--EXTENSIONS-- +uri +--FILE-- +withHost("ex@mple.com"); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified host is malformed (DomainInvalidCodePoint) diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special2.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special2.phpt new file mode 100644 index 0000000000000..a0626d99c51a6 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special2.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - forbidden domain code point +--EXTENSIONS-- +uri +--FILE-- +withHost("ex:mple.com"); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified host is malformed diff --git a/ext/uri/tests/whatwg/modification/host_error_unset_existing.phpt b/ext/uri/tests/whatwg/modification/host_error_unset_existing.phpt new file mode 100644 index 0000000000000..ca5d5a0201d7c --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_error_unset_existing.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withHost(null); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified host is malformed (HostMissing) diff --git a/ext/uri/tests/whatwg/modification/host_success_encoded.phpt b/ext/uri/tests/whatwg/modification/host_success_encoded.phpt new file mode 100644 index 0000000000000..bc7e583d13222 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_success_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withHost("t%65st.com"); // test.com + +var_dump($url1->getAsciiHost()); +var_dump($url2->getAsciiHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(8) "test.com" diff --git a/ext/uri/tests/whatwg/modification/host_success_existing.phpt b/ext/uri/tests/whatwg/modification/host_success_existing.phpt new file mode 100644 index 0000000000000..f26c1b33461d5 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_success_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withHost("test.com"); + +var_dump($url1->getAsciiHost()); +var_dump($url2->getAsciiHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(8) "test.com" diff --git a/ext/uri/tests/whatwg/modification/host_success_idna.phpt b/ext/uri/tests/whatwg/modification/host_success_idna.phpt new file mode 100644 index 0000000000000..040a984cd97ef --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_success_idna.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - IDNA characters +--EXTENSIONS-- +uri +--FILE-- +withHost("éxämple.com"); + +var_dump($url1->getAsciiHost()); +var_dump($url2->getAsciiHost()); +var_dump($url2->getUnicodeHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(19) "xn--xmple-gra7a.com" +string(13) "éxämple.com" diff --git a/ext/uri/tests/whatwg/modification/host_success_ipv4.phpt b/ext/uri/tests/whatwg/modification/host_success_ipv4.phpt new file mode 100644 index 0000000000000..9ea87840325d9 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_success_ipv4.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - IPv4 address +--EXTENSIONS-- +uri +--FILE-- +withHost("192.168.0.1"); + +var_dump($url1->getAsciiHost()); +var_dump($url2->getAsciiHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(11) "192.168.0.1" diff --git a/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt b/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt new file mode 100644 index 0000000000000..a2f10ea41a831 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - IPv6 address +--EXTENSIONS-- +uri +--FILE-- +withHost("[2001:db8:3333:4444:5555:6666:7777:8888]"); + +var_dump($url1->getAsciiHost()); +var_dump($url2->getAsciiHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" diff --git a/ext/uri/tests/whatwg/modification/password_success_auto_encoded.phpt b/ext/uri/tests/whatwg/modification/password_success_auto_encoded.phpt new file mode 100644 index 0000000000000..cf4cf89e0bb37 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/password_success_auto_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - password - characters from the percent encode set +--EXTENSIONS-- +uri +--FILE-- +withPassword("p:s/"); + +var_dump($url1->getPassword()); +var_dump($url2->getPassword()); + +?> +--EXPECT-- +string(8) "password" +string(8) "p%3As%2F" diff --git a/ext/uri/tests/whatwg/modification/password_success_encoded.phpt b/ext/uri/tests/whatwg/modification/password_success_encoded.phpt new file mode 100644 index 0000000000000..e4b607182c7f5 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/password_success_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - password - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withPassword("p%61ssword"); + +var_dump($url1->getPassword()); +var_dump($url2->getPassword()); + +?> +--EXPECT-- +NULL +string(10) "p%61ssword" diff --git a/ext/uri/tests/whatwg/modification/password_success_existing.phpt b/ext/uri/tests/whatwg/modification/password_success_existing.phpt new file mode 100644 index 0000000000000..f472a8e455fed --- /dev/null +++ b/ext/uri/tests/whatwg/modification/password_success_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - password - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withPassword("password"); + +var_dump($url1->getPassword()); +var_dump($url2->getPassword()); + +?> +--EXPECT-- +NULL +string(8) "password" diff --git a/ext/uri/tests/whatwg/modification/password_success_new.phpt b/ext/uri/tests/whatwg/modification/password_success_new.phpt new file mode 100644 index 0000000000000..1fa4d55dacb21 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/password_success_new.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - username - adding a new one +--EXTENSIONS-- +uri +--FILE-- +withPassword("password"); + +var_dump($url1->getPassword()); +var_dump($url2->getPassword()); + +?> +--EXPECT-- +NULL +string(8) "password" diff --git a/ext/uri/tests/whatwg/modification/password_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/password_success_unset_existing.phpt new file mode 100644 index 0000000000000..ca414fdc47063 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/password_success_unset_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - username - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withPassword(null); + +var_dump($url1->getPassword()); +var_dump($url2->getPassword()); + +?> +--EXPECT-- +string(8) "password" +NULL diff --git a/ext/uri/tests/whatwg/modification/password_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/password_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..a6f834ac3bfbf --- /dev/null +++ b/ext/uri/tests/whatwg/modification/password_success_unset_non_existent.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - username - unsetting non-existent +--EXTENSIONS-- +uri +--FILE-- +withPassword(null); + +var_dump($url1->getPassword()); +var_dump($url2->getPassword()); + +?> +--EXPECT-- +NULL +NULL diff --git a/ext/uri/tests/whatwg/modification/path_success_auto_encoded.phpt b/ext/uri/tests/whatwg/modification/path_success_auto_encoded.phpt new file mode 100644 index 0000000000000..b05829b52c9ce --- /dev/null +++ b/ext/uri/tests/whatwg/modification/path_success_auto_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - path - characters from the percent encode set +--EXTENSIONS-- +uri +--FILE-- +withPath("/p^th#"); + +var_dump($url1->getPath()); +var_dump($url2->getPath()); + +?> +--EXPECT-- +string(1) "/" +string(8) "/p^th%23" diff --git a/ext/uri/tests/whatwg/modification/path_success_empty.phpt b/ext/uri/tests/whatwg/modification/path_success_empty.phpt new file mode 100644 index 0000000000000..4b1d66ee85bb1 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/path_success_empty.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - path - empty string +--EXTENSIONS-- +uri +--FILE-- +withPath(""); + +var_dump($url1->getPath()); +var_dump($url2->getPath()); + +?> +--EXPECT-- +string(1) "/" +string(1) "/" diff --git a/ext/uri/tests/whatwg/modification/path_success_encoded.phpt b/ext/uri/tests/whatwg/modification/path_success_encoded.phpt new file mode 100644 index 0000000000000..618ac7fee7bb8 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/path_success_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - path - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withPath("/foo%2Fbar"); // /foo/bar + +var_dump($url1->getPath()); +var_dump($url2->getPath()); + +?> +--EXPECT-- +string(1) "/" +string(10) "/foo%2Fbar" diff --git a/ext/uri/tests/whatwg/modification/path_success_existing.phpt b/ext/uri/tests/whatwg/modification/path_success_existing.phpt new file mode 100644 index 0000000000000..9af49ad7e98e9 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/path_success_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - path - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withPath("/baz"); + +var_dump($url1->getPath()); +var_dump($url2->getPath()); + +?> +--EXPECT-- +string(8) "/foo/bar" +string(4) "/baz" diff --git a/ext/uri/tests/whatwg/modification/path_success_unicode.phpt b/ext/uri/tests/whatwg/modification/path_success_unicode.phpt new file mode 100644 index 0000000000000..6f454556f5ec9 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/path_success_unicode.phpt @@ -0,0 +1,16 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - path - unicode characters +--EXTENSIONS-- +uri +--FILE-- +withPath("/ő"); + +var_dump($url1->getPath()); +var_dump($url2->getPath()); +?> +--EXPECT-- +string(1) "/" +string(7) "/%C5%91" diff --git a/ext/uri/tests/whatwg/modification/path_success_without_leading_slash.phpt b/ext/uri/tests/whatwg/modification/path_success_without_leading_slash.phpt new file mode 100644 index 0000000000000..2fa9a13973d56 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/path_success_without_leading_slash.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - path - without leading slash +--EXTENSIONS-- +uri +--FILE-- +withPath("foo/bar"); + +var_dump($url1->getPath()); +var_dump($url2->getPath()); + +?> +--EXPECT-- +string(1) "/" +string(8) "/foo/bar" diff --git a/ext/uri/tests/whatwg/modification/port_error_negative.phpt b/ext/uri/tests/whatwg/modification/port_error_negative.phpt new file mode 100644 index 0000000000000..c0d070ffaf931 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_error_negative.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - negative +--EXTENSIONS-- +uri +--FILE-- +withPort(-1); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified port is malformed diff --git a/ext/uri/tests/whatwg/modification/port_error_overflow.phpt b/ext/uri/tests/whatwg/modification/port_error_overflow.phpt new file mode 100644 index 0000000000000..4faac86e632e4 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_error_overflow.phpt @@ -0,0 +1,22 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - port - too large port numbers don't overflow +--EXTENSIONS-- +uri +--FILE-- +withPort(9223372036854775808); + } else { + $url->withPort(2147483648); + } +} catch (TypeError $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +Uri\WhatWg\Url::withPort(): Argument #1 ($port) must be of type ?int, float given diff --git a/ext/uri/tests/whatwg/modification/port_error_too_large.phpt b/ext/uri/tests/whatwg/modification/port_error_too_large.phpt new file mode 100644 index 0000000000000..4060056b0a565 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_error_too_large.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - host - larger than a 16-bit unsigned integer +--EXTENSIONS-- +uri +--FILE-- +withPort(65536); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified port is malformed (PortOutOfRange) diff --git a/ext/uri/tests/whatwg/modification/port_success_existing.phpt b/ext/uri/tests/whatwg/modification/port_success_existing.phpt new file mode 100644 index 0000000000000..2d03acd1c6f44 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_success_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - port - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withPort(433); + +var_dump($url1->getPort()); +var_dump($url2->getPort()); + +?> +--EXPECT-- +int(80) +int(433) diff --git a/ext/uri/tests/whatwg/modification/port_success_new.phpt b/ext/uri/tests/whatwg/modification/port_success_new.phpt new file mode 100644 index 0000000000000..9089dd184babd --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_success_new.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - port - adding a new one +--EXTENSIONS-- +uri +--FILE-- +withPort(433); + +var_dump($url1->getPort()); +var_dump($url2->getPort()); + +?> +--EXPECT-- +NULL +int(433) diff --git a/ext/uri/tests/whatwg/modification/port_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/port_success_unset_existing.phpt new file mode 100644 index 0000000000000..0080cc3ec3727 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_success_unset_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - port - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withPort(null); + +var_dump($url1->getPort()); +var_dump($url2->getPort()); + +?> +--EXPECT-- +int(80) +NULL diff --git a/ext/uri/tests/whatwg/modification/port_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/port_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..ab56107708f20 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_success_unset_non_existent.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - port - unsetting non-existent +--EXTENSIONS-- +uri +--FILE-- +withPort(null); + +var_dump($url2->getPort()); +var_dump($url2->getPort()); + +?> +--EXPECT-- +NULL +NULL diff --git a/ext/uri/tests/whatwg/modification/query_success_auto_encoded.phpt b/ext/uri/tests/whatwg/modification/query_success_auto_encoded.phpt new file mode 100644 index 0000000000000..efe20f6893cd2 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_auto_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - characters from the percent encode set +--EXTENSIONS-- +uri +--FILE-- +withQuery("#foo "); + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +NULL +string(9) "%23foo%20" diff --git a/ext/uri/tests/whatwg/modification/query_success_context_senstivie_reserved.phpt b/ext/uri/tests/whatwg/modification/query_success_context_senstivie_reserved.phpt new file mode 100644 index 0000000000000..76394fa6926e0 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_context_senstivie_reserved.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - context-sensitive reserved character +--EXTENSIONS-- +uri +--FILE-- +withQuery("?foo=bar"); + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +NULL +string(7) "foo=bar" diff --git a/ext/uri/tests/whatwg/modification/query_success_empty.phpt b/ext/uri/tests/whatwg/modification/query_success_empty.phpt new file mode 100644 index 0000000000000..730f557f73c57 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_empty.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - empty string +--EXTENSIONS-- +uri +--FILE-- +withQuery(""); + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +NULL +NULL diff --git a/ext/uri/tests/whatwg/modification/query_success_encoded.phpt b/ext/uri/tests/whatwg/modification/query_success_encoded.phpt new file mode 100644 index 0000000000000..1c0cf898efd21 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withQuery("foo%3Dbar"); // foo=bar + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +NULL +string(9) "foo%3Dbar" diff --git a/ext/uri/tests/whatwg/modification/query_success_existing.phpt b/ext/uri/tests/whatwg/modification/query_success_existing.phpt new file mode 100644 index 0000000000000..6d40087472051 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - changing an existing one +--EXTENSIONS-- +uri +--FILE-- +withQuery("foo=bar&baz=qux"); + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +string(7) "foo=bar" +string(15) "foo=bar&baz=qux" diff --git a/ext/uri/tests/whatwg/modification/query_success_unicode.phpt b/ext/uri/tests/whatwg/modification/query_success_unicode.phpt new file mode 100644 index 0000000000000..825d463fdfdd9 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_unicode.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - unicode characters +--EXTENSIONS-- +uri +--FILE-- +withQuery("ő"); + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +NULL +string(6) "%C5%91" diff --git a/ext/uri/tests/whatwg/modification/query_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/query_success_unset_existing.phpt new file mode 100644 index 0000000000000..5afb3cfef61be --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_unset_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withQuery(null); + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +string(7) "foo=bar" +NULL diff --git a/ext/uri/tests/whatwg/modification/query_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/query_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..fe403a98c597f --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_unset_non_existent.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - unsetting not-existent +--EXTENSIONS-- +uri +--FILE-- +withQuery(null); + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +NULL +NULL diff --git a/ext/uri/tests/whatwg/modification/query_success_with_leading_question_mark.phpt b/ext/uri/tests/whatwg/modification/query_success_with_leading_question_mark.phpt new file mode 100644 index 0000000000000..8a27480f3c1b7 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/query_success_with_leading_question_mark.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - query - with leading question mark +--EXTENSIONS-- +uri +--FILE-- +withQuery("?foo=bar"); + +var_dump($url1->getQuery()); +var_dump($url2->getQuery()); + +?> +--EXPECT-- +NULL +string(7) "foo=bar" diff --git a/ext/uri/tests/whatwg/modification/scheme_error_empty.phpt b/ext/uri/tests/whatwg/modification/scheme_error_empty.phpt new file mode 100644 index 0000000000000..0460fa72945f6 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/scheme_error_empty.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - scheme - empty string +--EXTENSIONS-- +uri +--FILE-- +withScheme(""); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified scheme is malformed diff --git a/ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt b/ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt new file mode 100644 index 0000000000000..a52dc65dadd8a --- /dev/null +++ b/ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - scheme - URL encoded characters +--EXTENSIONS-- +uri +--FILE-- +withScheme("http%73"); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified scheme is malformed diff --git a/ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt b/ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt new file mode 100644 index 0000000000000..21cd04346a3c3 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - scheme - invalid characters +--EXTENSIONS-- +uri +--FILE-- +withScheme("http?"); +} catch (Uri\WhatWg\InvalidUrlException $e) { + echo $e->getMessage() . "\n"; +} + +?> +--EXPECT-- +The specified scheme is malformed diff --git a/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt b/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt new file mode 100644 index 0000000000000..61b8c82a885bb --- /dev/null +++ b/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - scheme - basic case +--EXTENSIONS-- +uri +--FILE-- +withScheme("http"); + +var_dump($url1->getScheme()); +var_dump($url2->getScheme()); + +?> +--EXPECT-- +string(5) "https" +string(4) "http" diff --git a/ext/uri/tests/whatwg/modification/scheme_success_colon.phpt b/ext/uri/tests/whatwg/modification/scheme_success_colon.phpt new file mode 100644 index 0000000000000..abde11ab58f5b --- /dev/null +++ b/ext/uri/tests/whatwg/modification/scheme_success_colon.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - scheme - trailing colon +--EXTENSIONS-- +uri +--FILE-- +withScheme("http:"); + +var_dump($url1->getScheme()); +var_dump($url2->getScheme()); + +?> +--EXPECT-- +string(5) "https" +string(4) "http" diff --git a/ext/uri/tests/whatwg/modification/scheme_success_full.phpt b/ext/uri/tests/whatwg/modification/scheme_success_full.phpt new file mode 100644 index 0000000000000..b849a5f44be04 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/scheme_success_full.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - scheme - trailing colon and double slash +--EXTENSIONS-- +uri +--FILE-- +withScheme("http://"); + +var_dump($url1->getScheme()); +var_dump($url2->getScheme()); + +?> +--EXPECT-- +string(5) "https" +string(4) "http" diff --git a/ext/uri/tests/whatwg/modification/username_success_auto_encoded.phpt b/ext/uri/tests/whatwg/modification/username_success_auto_encoded.phpt new file mode 100644 index 0000000000000..2636c31c2e544 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/username_success_auto_encoded.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - username - characters from the percent encode set +--EXTENSIONS-- +uri +--FILE-- +withUsername("u:s/r"); + +var_dump($url1->getUsername()); +var_dump($url2->getUsername()); + +?> +--EXPECT-- +string(4) "user" +string(9) "u%3As%2Fr" diff --git a/ext/uri/tests/whatwg/modification/username_success_existing.phpt b/ext/uri/tests/whatwg/modification/username_success_existing.phpt new file mode 100644 index 0000000000000..5a247ae903a1b --- /dev/null +++ b/ext/uri/tests/whatwg/modification/username_success_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - username - changing existing +--EXTENSIONS-- +uri +--FILE-- +withUsername("username"); + +var_dump($url1->getUsername()); +var_dump($url2->getUsername()); + +?> +--EXPECT-- +NULL +string(8) "username" diff --git a/ext/uri/tests/whatwg/modification/username_success_new.phpt b/ext/uri/tests/whatwg/modification/username_success_new.phpt new file mode 100644 index 0000000000000..e95089091c0f4 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/username_success_new.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - username - adding a new one +--EXTENSIONS-- +uri +--FILE-- +withUsername("username"); + +var_dump($url1->getUsername()); +var_dump($url2->getUsername()); + +?> +--EXPECT-- +NULL +string(8) "username" diff --git a/ext/uri/tests/whatwg/modification/username_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/username_success_unset_existing.phpt new file mode 100644 index 0000000000000..1243ad7dc48a6 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/username_success_unset_existing.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - username - unsetting existing +--EXTENSIONS-- +uri +--FILE-- +withUsername(null); + +var_dump($url1->getUsername()); +var_dump($url2->getUsername()); + +?> +--EXPECT-- +string(8) "username" +NULL diff --git a/ext/uri/tests/whatwg/modification/username_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/username_success_unset_non_existent.phpt new file mode 100644 index 0000000000000..22f63c3df88a1 --- /dev/null +++ b/ext/uri/tests/whatwg/modification/username_success_unset_non_existent.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - username - unsetting non-existent +--EXTENSIONS-- +uri +--FILE-- +withUsername(null); + +var_dump($url1->getUsername()); +var_dump($url2->getUsername()); + +?> +--EXPECT-- +NULL +NULL From d32421fd5ec2b23d8a3a30b6801842b6928a2a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 28 Sep 2025 14:47:53 +0200 Subject: [PATCH 2/5] Address review comments --- .../fragment_success_encoded.phpt | 5 ++--- .../modification/host_success_ip_future.phpt | 19 +++++++++++++++++++ .../modification/host_success_ipv6.phpt | 6 +++--- .../modification/path_error_reserved.phpt | 2 +- .../modification/port_success_existing.phpt | 4 ++-- .../modification/port_success_new.phpt | 4 ++-- .../modification/query_success_encoded.phpt | 5 ++--- .../modification/scheme_error_empty.phpt | 1 - .../modification/scheme_error_reserved.phpt | 2 +- .../userinfo_success_existing.phpt | 6 +++--- .../modification/userinfo_success_new.phpt | 4 ++-- .../fragment_success_encoded.phpt | 4 ++-- .../modification/host_success_ipv6.phpt | 2 +- .../modification/port_success_existing.phpt | 6 +++--- .../whatwg/modification/port_success_new.phpt | 6 +++--- .../modification/port_success_special1.phpt | 17 +++++++++++++++++ .../modification/port_success_special2.phpt | 17 +++++++++++++++++ .../modification/query_success_encoded.phpt | 4 ++-- 18 files changed, 82 insertions(+), 32 deletions(-) create mode 100644 ext/uri/tests/rfc3986/modification/host_success_ip_future.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_success_special1.phpt create mode 100644 ext/uri/tests/whatwg/modification/port_success_special2.phpt diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt index f2e420e2c85bd..76ceebee339b7 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt @@ -6,7 +6,7 @@ uri withFragment("foo%3Dbar"); // foo=bar +$uri2 = $uri1->withFragment("foo%3dbar"); // foo=bar var_dump($uri1->getRawFragment()); var_dump($uri2->getRawFragment()); @@ -15,6 +15,5 @@ var_dump($uri2->getFragment()); ?> --EXPECT-- NULL +string(9) "foo%3dbar" string(9) "foo%3Dbar" -string(9) "foo%3Dbar" - diff --git a/ext/uri/tests/rfc3986/modification/host_success_ip_future.phpt b/ext/uri/tests/rfc3986/modification/host_success_ip_future.phpt new file mode 100644 index 0000000000000..0d4bb64bb580b --- /dev/null +++ b/ext/uri/tests/rfc3986/modification/host_success_ip_future.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test Uri\Rfc3986\Uri component modification - host - IP future address +--EXTENSIONS-- +uri +--FILE-- +withHost("[vF.addr]"); + +var_dump($uri1->getRawHost()); +var_dump($uri2->getRawHost()); +var_dump($uri2->getHost()); + +?> +--EXPECT-- +string(11) "example.com" +string(9) "[vF.addr]" +string(9) "[vf.addr]" diff --git a/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt b/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt index afd5bbae45cc0..f049e034d5c2c 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt @@ -6,7 +6,7 @@ uri withHost("[2001:db8:3333:4444:5555:6666:7777:8888]"); +$uri2 = $uri1->withHost("[2001:0db8:3333:4444:5555:6666:7777:8888]"); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); @@ -15,5 +15,5 @@ var_dump($uri2->getHost()); ?> --EXPECT-- string(11) "example.com" -string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" -string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" +string(41) "[2001:0db8:3333:4444:5555:6666:7777:8888]" +string(41) "[2001:0db8:3333:4444:5555:6666:7777:8888]" diff --git a/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt index 9f794ec41e922..2da84e2689b3b 100644 --- a/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt @@ -8,7 +8,7 @@ uri $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { - $uri->withPath("@foo"); + $uri->withPath("/[foo]"); } catch (Uri\InvalidUriException $e) { echo $e->getMessage() . "\n"; } diff --git a/ext/uri/tests/rfc3986/modification/port_success_existing.phpt b/ext/uri/tests/rfc3986/modification/port_success_existing.phpt index c777c7f7d29bb..8b94a20fc6ca9 100644 --- a/ext/uri/tests/rfc3986/modification/port_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/port_success_existing.phpt @@ -6,7 +6,7 @@ uri withPort(433); +$uri2 = $uri1->withPort(443); var_dump($uri1->getPort()); var_dump($uri2->getPort()); @@ -14,4 +14,4 @@ var_dump($uri2->getPort()); ?> --EXPECT-- int(80) -int(433) +int(443) diff --git a/ext/uri/tests/rfc3986/modification/port_success_new.phpt b/ext/uri/tests/rfc3986/modification/port_success_new.phpt index c12a194bc3307..830cc3822ac5a 100644 --- a/ext/uri/tests/rfc3986/modification/port_success_new.phpt +++ b/ext/uri/tests/rfc3986/modification/port_success_new.phpt @@ -6,7 +6,7 @@ uri withPort(433); +$uri2 = $uri1->withPort(443); var_dump($uri1->getPort()); var_dump($uri2->getPort()); @@ -14,4 +14,4 @@ var_dump($uri2->getPort()); ?> --EXPECT-- NULL -int(433) +int(443) diff --git a/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt index 207c7d6523ddd..e7542fb3cd4f7 100644 --- a/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt @@ -6,7 +6,7 @@ uri withQuery("foo%3Dbar"); // foo=bar +$uri2 = $uri1->withQuery("foo%3dbar"); // foo=bar var_dump($uri1->getRawQuery()); var_dump($uri2->getRawQuery()); @@ -15,6 +15,5 @@ var_dump($uri2->getQuery()); ?> --EXPECT-- NULL +string(9) "foo%3dbar" string(9) "foo%3Dbar" -string(9) "foo%3Dbar" - diff --git a/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt b/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt index c73c40d050b28..477be1d2331c6 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt @@ -16,4 +16,3 @@ try { ?> --EXPECT-- The specified scheme is malformed - diff --git a/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt index f786ef1b67e81..dd3bcc02f83e3 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt @@ -1,5 +1,5 @@ --TEST-- -Test Uri\Rfc3986\Uri component modification - scheme - URL encoded characters +Test Uri\Rfc3986\Uri component modification - scheme - reserved characters --EXTENSIONS-- uri --FILE-- diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt index 2c35cc4c3ce06..e602c80e77b03 100644 --- a/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt @@ -1,11 +1,11 @@ --TEST-- -Test Uri\Rfc3986\Uri omponent modification - userinfo - changing an existing one +Test Uri\Rfc3986\Uri component modification - userinfo - changing an existing one --EXTENSIONS-- uri --FILE-- withUserInfo("user:password"); var_dump($uri1->getRawUserInfo()); @@ -14,6 +14,6 @@ var_dump($uri2->getUserInfo()); ?> --EXPECT-- -NULL +string(5) ":pass" string(13) "user:password" string(13) "user:password" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt index 397ae5dd2cb7c..6e1ec1b4fa3de 100644 --- a/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt @@ -5,7 +5,7 @@ uri --FILE-- withUserInfo("user:password"); var_dump($uri1->getRawUserInfo()); @@ -14,6 +14,6 @@ var_dump($uri2->getUserInfo()); ?> --EXPECT-- -string(5) ":pass" +NULL string(13) "user:password" string(13) "user:password" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt b/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt index 33f8317b249a2..1a2a2bebf1d19 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt @@ -6,7 +6,7 @@ uri withFragment("foo%3Dbar"); // foo=bar +$uri2 = $uri1->withFragment("foo%3dbar"); // foo=bar var_dump($uri1->getFragment()); var_dump($uri2->getFragment()); @@ -14,4 +14,4 @@ var_dump($uri2->getFragment()); ?> --EXPECT-- NULL -string(9) "foo%3Dbar" +string(9) "foo%3dbar" diff --git a/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt b/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt index a2f10ea41a831..dce80fcfe9cf1 100644 --- a/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt +++ b/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt @@ -6,7 +6,7 @@ uri withHost("[2001:db8:3333:4444:5555:6666:7777:8888]"); +$url2 = $url1->withHost("[2001:0db8:3333:4444:5555:6666:7777:8888]"); var_dump($url1->getAsciiHost()); var_dump($url2->getAsciiHost()); diff --git a/ext/uri/tests/whatwg/modification/port_success_existing.phpt b/ext/uri/tests/whatwg/modification/port_success_existing.phpt index 2d03acd1c6f44..85118b85a4c1c 100644 --- a/ext/uri/tests/whatwg/modification/port_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/port_success_existing.phpt @@ -5,8 +5,8 @@ uri --FILE-- withPort(433); +$url1 = Uri\WhatWg\Url::parse("scheme://example.com:80"); +$url2 = $url1->withPort(443); var_dump($url1->getPort()); var_dump($url2->getPort()); @@ -14,4 +14,4 @@ var_dump($url2->getPort()); ?> --EXPECT-- int(80) -int(433) +int(443) diff --git a/ext/uri/tests/whatwg/modification/port_success_new.phpt b/ext/uri/tests/whatwg/modification/port_success_new.phpt index 9089dd184babd..4825447cf2c05 100644 --- a/ext/uri/tests/whatwg/modification/port_success_new.phpt +++ b/ext/uri/tests/whatwg/modification/port_success_new.phpt @@ -5,8 +5,8 @@ uri --FILE-- withPort(433); +$url1 = Uri\WhatWg\Url::parse("scheme://example.com"); +$url2 = $url1->withPort(443); var_dump($url1->getPort()); var_dump($url2->getPort()); @@ -14,4 +14,4 @@ var_dump($url2->getPort()); ?> --EXPECT-- NULL -int(433) +int(443) diff --git a/ext/uri/tests/whatwg/modification/port_success_special1.phpt b/ext/uri/tests/whatwg/modification/port_success_special1.phpt new file mode 100644 index 0000000000000..65867d798eead --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_success_special1.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - port - adding a new one for a special URL +--EXTENSIONS-- +uri +--FILE-- +withPort(80); + +var_dump($url1->getPort()); +var_dump($url2->getPort()); + +?> +--EXPECT-- +int(88) +NULL diff --git a/ext/uri/tests/whatwg/modification/port_success_special2.phpt b/ext/uri/tests/whatwg/modification/port_success_special2.phpt new file mode 100644 index 0000000000000..f6f6e9e9d9f1b --- /dev/null +++ b/ext/uri/tests/whatwg/modification/port_success_special2.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test Uri\WhatWg\Url component modification - port - adding a new one for a special URL +--EXTENSIONS-- +uri +--FILE-- +withPort(443); + +var_dump($url1->getPort()); +var_dump($url2->getPort()); + +?> +--EXPECT-- +NULL +NULL diff --git a/ext/uri/tests/whatwg/modification/query_success_encoded.phpt b/ext/uri/tests/whatwg/modification/query_success_encoded.phpt index 1c0cf898efd21..8b95aa68976c6 100644 --- a/ext/uri/tests/whatwg/modification/query_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_encoded.phpt @@ -6,7 +6,7 @@ uri withQuery("foo%3Dbar"); // foo=bar +$url2 = $url1->withQuery("foo%3dbar"); // foo=bar var_dump($url1->getQuery()); var_dump($url2->getQuery()); @@ -14,4 +14,4 @@ var_dump($url2->getQuery()); ?> --EXPECT-- NULL -string(9) "foo%3Dbar" +string(9) "foo%3dbar" From 26e17e425eef75e0b2b75b5846ab66098ff0063d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sat, 4 Oct 2025 15:38:20 +0200 Subject: [PATCH 3/5] Display full URI --- .../rfc3986/modification/fragment_success_empty.phpt | 4 ++++ .../rfc3986/modification/fragment_success_encoded.phpt | 4 ++++ .../modification/fragment_success_existing.phpt | 4 ++++ .../modification/fragment_success_unset_existing.phpt | 4 ++++ .../fragment_success_unset_non_existent.phpt | 4 ++++ .../tests/rfc3986/modification/host_success_empty.phpt | 4 ++++ .../rfc3986/modification/host_success_encoded.phpt | 4 ++++ .../rfc3986/modification/host_success_existing.phpt | 4 ++++ .../rfc3986/modification/host_success_ip_future.phpt | 4 ++++ .../tests/rfc3986/modification/host_success_ipv4.phpt | 4 ++++ .../tests/rfc3986/modification/host_success_ipv6.phpt | 4 ++++ .../tests/rfc3986/modification/host_success_new.phpt | 4 ++++ .../modification/host_success_unset_existing.phpt | 4 ++++ .../modification/host_success_unset_non_existent.phpt | 4 ++++ .../tests/rfc3986/modification/path_success_email.phpt | 4 ++++ .../tests/rfc3986/modification/path_success_empty.phpt | 4 ++++ .../rfc3986/modification/path_success_encoded.phpt | 4 ++++ .../rfc3986/modification/path_success_existing.phpt | 4 ++++ .../rfc3986/modification/port_success_existing.phpt | 2 ++ .../tests/rfc3986/modification/port_success_new.phpt | 2 ++ .../modification/port_success_unset_existing.phpt | 2 ++ .../modification/port_success_unset_non_existent.phpt | 2 ++ .../query_success_context_senstive_reserved.phpt | 4 ++++ .../rfc3986/modification/query_success_empty.phpt | 4 ++++ .../rfc3986/modification/query_success_encoded.phpt | 4 ++++ .../rfc3986/modification/query_success_existing.phpt | 4 ++++ .../modification/query_success_unset_existing.phpt | 4 ++++ .../modification/query_success_unset_non_existent.phpt | 4 ++++ .../rfc3986/modification/roundtrip_special_case1.phpt | 4 ++++ .../rfc3986/modification/scheme_success_basic.phpt | 4 ++++ .../modification/scheme_success_unset_existing.phpt | 4 ++++ .../scheme_success_unset_non_existent.phpt | 4 ++++ .../rfc3986/modification/userinfo_success_encoded.phpt | 4 ++++ .../modification/userinfo_success_existing.phpt | 4 ++++ .../rfc3986/modification/userinfo_success_new.phpt | 4 ++++ .../modification/userinfo_success_unset_existing.phpt | 4 ++++ .../userinfo_success_unset_non_existent.phpt | 4 ++++ .../modification/fragment_success_auto_encode.phpt | 10 ++++++---- .../whatwg/modification/fragment_success_empty.phpt | 10 ++++++---- .../whatwg/modification/fragment_success_encoded.phpt | 10 ++++++---- .../whatwg/modification/fragment_success_existing.phpt | 10 ++++++---- .../whatwg/modification/fragment_success_unicode.phpt | 10 ++++++---- .../modification/fragment_success_unset_existing.phpt | 10 ++++++---- .../fragment_success_unset_non_existent.phpt | 10 ++++++---- .../fragment_success_with_leading_hashmark.phpt | 10 ++++++---- .../whatwg/modification/host_success_encoded.phpt | 2 ++ .../whatwg/modification/host_success_existing.phpt | 2 ++ .../tests/whatwg/modification/host_success_idna.phpt | 4 ++++ .../tests/whatwg/modification/host_success_ipv4.phpt | 2 ++ .../tests/whatwg/modification/host_success_ipv6.phpt | 2 ++ .../modification/password_success_auto_encoded.phpt | 2 ++ .../whatwg/modification/password_success_encoded.phpt | 2 ++ .../whatwg/modification/password_success_existing.phpt | 2 ++ .../whatwg/modification/password_success_new.phpt | 2 ++ .../modification/password_success_unset_existing.phpt | 2 ++ .../password_success_unset_non_existent.phpt | 2 ++ .../whatwg/modification/path_success_auto_encoded.phpt | 2 ++ .../tests/whatwg/modification/path_success_empty.phpt | 2 ++ .../whatwg/modification/path_success_encoded.phpt | 2 ++ .../whatwg/modification/path_success_existing.phpt | 2 ++ .../whatwg/modification/path_success_unicode.phpt | 2 ++ .../path_success_without_leading_slash.phpt | 2 ++ .../whatwg/modification/port_success_existing.phpt | 2 ++ .../tests/whatwg/modification/port_success_new.phpt | 2 ++ .../whatwg/modification/port_success_special1.phpt | 2 ++ .../whatwg/modification/port_success_special2.phpt | 2 ++ .../modification/port_success_unset_existing.phpt | 2 ++ .../modification/port_success_unset_non_existent.phpt | 2 ++ .../modification/query_success_auto_encoded.phpt | 2 ++ .../query_success_context_senstivie_reserved.phpt | 2 ++ .../tests/whatwg/modification/query_success_empty.phpt | 2 ++ .../whatwg/modification/query_success_encoded.phpt | 2 ++ .../whatwg/modification/query_success_existing.phpt | 2 ++ .../whatwg/modification/query_success_unicode.phpt | 2 ++ .../modification/query_success_unset_existing.phpt | 2 ++ .../modification/query_success_unset_non_existent.phpt | 2 ++ .../query_success_with_leading_question_mark.phpt | 2 ++ .../whatwg/modification/scheme_success_basic.phpt | 2 ++ .../whatwg/modification/scheme_success_colon.phpt | 2 ++ .../tests/whatwg/modification/scheme_success_full.phpt | 2 ++ .../modification/username_success_auto_encoded.phpt | 2 ++ .../whatwg/modification/username_success_existing.phpt | 2 ++ .../whatwg/modification/username_success_new.phpt | 2 ++ .../modification/username_success_unset_existing.phpt | 2 ++ .../username_success_unset_non_existent.phpt | 2 ++ 85 files changed, 270 insertions(+), 32 deletions(-) diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_empty.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_empty.phpt index bf29384ec57e3..f0a05d5bb5bb0 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_success_empty.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_success_empty.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withFragment(""); var_dump($uri1->getRawFragment()); var_dump($uri2->getRawFragment()); +var_dump($uri2->toRawString()); var_dump($uri2->getFragment()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL string(0) "" +string(20) "https://example.com#" string(0) "" +string(20) "https://example.com#" diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt index 76ceebee339b7..4b6ccb2f7aa31 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withFragment("foo%3dbar"); // foo=bar var_dump($uri1->getRawFragment()); var_dump($uri2->getRawFragment()); +var_dump($uri2->toRawString()); var_dump($uri2->getFragment()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL string(9) "foo%3dbar" +string(29) "https://example.com#foo%3dbar" string(9) "foo%3Dbar" +string(29) "https://example.com#foo%3Dbar" diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_existing.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_existing.phpt index 8690c5e36f2a1..fe534e8465041 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_success_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withFragment("bar"); var_dump($uri1->getRawFragment()); var_dump($uri2->getRawFragment()); +var_dump($uri2->toRawString()); var_dump($uri2->getFragment()); +var_dump($uri2->toString()); ?> --EXPECT-- string(3) "foo" string(3) "bar" +string(23) "https://example.com#bar" string(3) "bar" +string(23) "https://example.com#bar" diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_unset_existing.phpt index b6014ac021af7..7532c35e0fe76 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_success_unset_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_success_unset_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withFragment(null); var_dump($uri1->getRawFragment()); var_dump($uri2->getRawFragment()); +var_dump($uri2->toRawString()); var_dump($uri2->getFragment()); +var_dump($uri2->toString()); ?> --EXPECT-- string(3) "foo" NULL +string(19) "https://example.com" NULL +string(19) "https://example.com" diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_unset_non_existent.phpt index 6542c62a4ac01..1c6fa898dde36 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_success_unset_non_existent.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_success_unset_non_existent.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withFragment(null); var_dump($uri1->getRawFragment()); var_dump($uri2->getRawFragment()); +var_dump($uri2->toRawString()); var_dump($uri2->getFragment()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL NULL +string(19) "https://example.com" NULL +string(19) "https://example.com" diff --git a/ext/uri/tests/rfc3986/modification/host_success_empty.phpt b/ext/uri/tests/rfc3986/modification/host_success_empty.phpt index 0a51a6681a1f1..b337674841c6b 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_empty.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_empty.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost(""); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" string(0) "" +string(8) "https://" string(0) "" +string(8) "https://" diff --git a/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt index 2b71caf85df41..3db01109e1dbb 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost("t%65st.com"); // test.com var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" string(10) "t%65st.com" +string(18) "https://t%65st.com" string(8) "test.com" +string(16) "https://test.com" diff --git a/ext/uri/tests/rfc3986/modification/host_success_existing.phpt b/ext/uri/tests/rfc3986/modification/host_success_existing.phpt index 7a1dbd94b9bd5..140eb60ecad58 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost("test.com"); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" string(8) "test.com" +string(16) "https://test.com" string(8) "test.com" +string(16) "https://test.com" diff --git a/ext/uri/tests/rfc3986/modification/host_success_ip_future.phpt b/ext/uri/tests/rfc3986/modification/host_success_ip_future.phpt index 0d4bb64bb580b..004210000cf43 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_ip_future.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_ip_future.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost("[vF.addr]"); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" string(9) "[vF.addr]" +string(17) "https://[vF.addr]" string(9) "[vf.addr]" +string(17) "https://[vf.addr]" diff --git a/ext/uri/tests/rfc3986/modification/host_success_ipv4.phpt b/ext/uri/tests/rfc3986/modification/host_success_ipv4.phpt index 6c69b2410e42d..850a32281aba6 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_ipv4.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_ipv4.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost("192.168.0.1"); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" string(11) "192.168.0.1" +string(19) "https://192.168.0.1" string(11) "192.168.0.1" +string(19) "https://192.168.0.1" diff --git a/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt b/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt index f049e034d5c2c..4750888401599 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_ipv6.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost("[2001:0db8:3333:4444:5555:6666:7777:8888]"); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" string(41) "[2001:0db8:3333:4444:5555:6666:7777:8888]" +string(49) "https://[2001:0db8:3333:4444:5555:6666:7777:8888]" string(41) "[2001:0db8:3333:4444:5555:6666:7777:8888]" +string(49) "https://[2001:0db8:3333:4444:5555:6666:7777:8888]" diff --git a/ext/uri/tests/rfc3986/modification/host_success_new.phpt b/ext/uri/tests/rfc3986/modification/host_success_new.phpt index a8903324df25c..326616140078f 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_new.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_new.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost("example.com"); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL string(11) "example.com" +string(21) "//example.com/foo/bar" string(11) "example.com" +string(21) "//example.com/foo/bar" diff --git a/ext/uri/tests/rfc3986/modification/host_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/host_success_unset_existing.phpt index 1afc0f07f9241..521b6397ec450 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_unset_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_unset_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost(null); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" NULL +string(7) "https:/" NULL +string(7) "https:/" diff --git a/ext/uri/tests/rfc3986/modification/host_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/host_success_unset_non_existent.phpt index da6cff9fbe473..b1793a31413ab 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_unset_non_existent.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_unset_non_existent.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withHost(null); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); +var_dump($uri2->toRawString()); var_dump($uri2->getHost()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL NULL +string(8) "/foo/bar" NULL +string(8) "/foo/bar" diff --git a/ext/uri/tests/rfc3986/modification/path_success_email.phpt b/ext/uri/tests/rfc3986/modification/path_success_email.phpt index a3b3eba31bab6..58f5ab4baa6d5 100644 --- a/ext/uri/tests/rfc3986/modification/path_success_email.phpt +++ b/ext/uri/tests/rfc3986/modification/path_success_email.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withPath("john.doe@example.com"); var_dump($uri1->getRawPath()); var_dump($uri2->getRawPath()); +var_dump($uri2->toRawString()); var_dump($uri2->getPath()); +var_dump($uri2->toString()); ?> --EXPECT-- string(0) "" string(20) "john.doe@example.com" string(20) "john.doe@example.com" +string(20) "john.doe@example.com" +string(20) "john.doe@example.com" diff --git a/ext/uri/tests/rfc3986/modification/path_success_empty.phpt b/ext/uri/tests/rfc3986/modification/path_success_empty.phpt index b1854d5f3c4da..a67eeae44eed4 100644 --- a/ext/uri/tests/rfc3986/modification/path_success_empty.phpt +++ b/ext/uri/tests/rfc3986/modification/path_success_empty.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withPath(""); var_dump($uri1->getRawPath()); var_dump($uri2->getRawPath()); +var_dump($uri2->toRawString()); var_dump($uri2->getPath()); +var_dump($uri2->toString()); ?> --EXPECT-- string(0) "" string(0) "" +string(19) "https://example.com" string(0) "" +string(19) "https://example.com" diff --git a/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt index 833271733fd88..7f94ee8fd7d27 100644 --- a/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withPath("/foo%2Fbar"); // /foo/bar var_dump($uri1->getRawPath()); var_dump($uri2->getRawPath()); +var_dump($uri2->toRawString()); var_dump($uri2->getPath()); +var_dump($uri2->toString()); ?> --EXPECT-- string(0) "" string(10) "/foo%2Fbar" +string(29) "https://example.com/foo%2Fbar" string(10) "/foo%2Fbar" +string(29) "https://example.com/foo%2Fbar" diff --git a/ext/uri/tests/rfc3986/modification/path_success_existing.phpt b/ext/uri/tests/rfc3986/modification/path_success_existing.phpt index 17f1a0c0183ad..6dafbc0a3ff80 100644 --- a/ext/uri/tests/rfc3986/modification/path_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/path_success_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withPath("/baz"); var_dump($uri1->getRawPath()); var_dump($uri2->getRawPath()); +var_dump($uri2->toRawString()); var_dump($uri2->getPath()); +var_dump($uri2->toString()); ?> --EXPECT-- string(8) "/foo/bar" string(4) "/baz" +string(23) "https://example.com/baz" string(4) "/baz" +string(23) "https://example.com/baz" diff --git a/ext/uri/tests/rfc3986/modification/port_success_existing.phpt b/ext/uri/tests/rfc3986/modification/port_success_existing.phpt index 8b94a20fc6ca9..8451f1bcf4690 100644 --- a/ext/uri/tests/rfc3986/modification/port_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/port_success_existing.phpt @@ -10,8 +10,10 @@ $uri2 = $uri1->withPort(443); var_dump($uri1->getPort()); var_dump($uri2->getPort()); +var_dump($uri2->toRawString()); ?> --EXPECT-- int(80) int(443) +string(23) "https://example.com:443" diff --git a/ext/uri/tests/rfc3986/modification/port_success_new.phpt b/ext/uri/tests/rfc3986/modification/port_success_new.phpt index 830cc3822ac5a..36ccea04a9497 100644 --- a/ext/uri/tests/rfc3986/modification/port_success_new.phpt +++ b/ext/uri/tests/rfc3986/modification/port_success_new.phpt @@ -10,8 +10,10 @@ $uri2 = $uri1->withPort(443); var_dump($uri1->getPort()); var_dump($uri2->getPort()); +var_dump($uri2->toRawString()); ?> --EXPECT-- NULL int(443) +string(23) "https://example.com:443" diff --git a/ext/uri/tests/rfc3986/modification/port_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/port_success_unset_existing.phpt index 301b2070f4e9f..574af3f6e3ee7 100644 --- a/ext/uri/tests/rfc3986/modification/port_success_unset_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/port_success_unset_existing.phpt @@ -10,8 +10,10 @@ $uri2 = $uri1->withPort(null); var_dump($uri1->getPort()); var_dump($uri2->getPort()); +var_dump($uri2->toRawString()); ?> --EXPECT-- int(80) NULL +string(19) "https://example.com" diff --git a/ext/uri/tests/rfc3986/modification/port_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/port_success_unset_non_existent.phpt index 101718f64b066..a3fbdc5e87422 100644 --- a/ext/uri/tests/rfc3986/modification/port_success_unset_non_existent.phpt +++ b/ext/uri/tests/rfc3986/modification/port_success_unset_non_existent.phpt @@ -10,8 +10,10 @@ $uri2 = $uri1->withPort(null); var_dump($uri2->getPort()); var_dump($uri2->getPort()); +var_dump($uri2->toRawString()); ?> --EXPECT-- NULL NULL +string(17) "ftp://example.com" diff --git a/ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt b/ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt index 9edfbf333c2f0..d40a7f7e09efb 100644 --- a/ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withQuery("?foo=bar"); var_dump($uri1->getRawQuery()); var_dump($uri2->getRawQuery()); +var_dump($uri2->toRawString()); var_dump($uri2->getQuery()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL string(8) "?foo=bar" +string(28) "https://example.com??foo=bar" string(8) "?foo=bar" +string(28) "https://example.com??foo=bar" diff --git a/ext/uri/tests/rfc3986/modification/query_success_empty.phpt b/ext/uri/tests/rfc3986/modification/query_success_empty.phpt index d6a728b6d6c44..e668b44df9b3a 100644 --- a/ext/uri/tests/rfc3986/modification/query_success_empty.phpt +++ b/ext/uri/tests/rfc3986/modification/query_success_empty.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withQuery(""); var_dump($uri1->getRawQuery()); var_dump($uri2->getRawQuery()); +var_dump($uri2->toRawString()); var_dump($uri2->getQuery()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL string(0) "" +string(20) "https://example.com?" string(0) "" +string(20) "https://example.com?" diff --git a/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt index e7542fb3cd4f7..7fd9707220d88 100644 --- a/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/query_success_encoded.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withQuery("foo%3dbar"); // foo=bar var_dump($uri1->getRawQuery()); var_dump($uri2->getRawQuery()); +var_dump($uri2->toRawString()); var_dump($uri2->getQuery()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL string(9) "foo%3dbar" +string(29) "https://example.com?foo%3dbar" string(9) "foo%3Dbar" +string(29) "https://example.com?foo%3Dbar" diff --git a/ext/uri/tests/rfc3986/modification/query_success_existing.phpt b/ext/uri/tests/rfc3986/modification/query_success_existing.phpt index 459f135fa5e3b..b5af7feee2507 100644 --- a/ext/uri/tests/rfc3986/modification/query_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/query_success_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withQuery("foo=bar&baz=qux"); var_dump($uri1->getRawQuery()); var_dump($uri2->getRawQuery()); +var_dump($uri2->toRawString()); var_dump($uri2->getQuery()); +var_dump($uri2->toString()); ?> --EXPECT-- string(7) "foo=bar" string(15) "foo=bar&baz=qux" +string(35) "https://example.com?foo=bar&baz=qux" string(15) "foo=bar&baz=qux" +string(35) "https://example.com?foo=bar&baz=qux" diff --git a/ext/uri/tests/rfc3986/modification/query_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/query_success_unset_existing.phpt index 61b4a0fbdc5cf..89d130eedc27b 100644 --- a/ext/uri/tests/rfc3986/modification/query_success_unset_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/query_success_unset_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withQuery(null); var_dump($uri1->getRawQuery()); var_dump($uri2->getRawQuery()); +var_dump($uri2->toRawString()); var_dump($uri2->getQuery()); +var_dump($uri2->toString()); ?> --EXPECT-- string(7) "foo=bar" NULL +string(19) "https://example.com" NULL +string(19) "https://example.com" diff --git a/ext/uri/tests/rfc3986/modification/query_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/query_success_unset_non_existent.phpt index 0290b5bf77cd2..d9dfcd2083100 100644 --- a/ext/uri/tests/rfc3986/modification/query_success_unset_non_existent.phpt +++ b/ext/uri/tests/rfc3986/modification/query_success_unset_non_existent.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withQuery(null); var_dump($uri1->getRawQuery()); var_dump($uri2->getRawQuery()); +var_dump($uri2->toRawString()); var_dump($uri2->getQuery()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL NULL +string(19) "https://example.com" NULL +string(19) "https://example.com" diff --git a/ext/uri/tests/rfc3986/modification/roundtrip_special_case1.phpt b/ext/uri/tests/rfc3986/modification/roundtrip_special_case1.phpt index c7f2dba8508ae..4349764d4dd1f 100644 --- a/ext/uri/tests/rfc3986/modification/roundtrip_special_case1.phpt +++ b/ext/uri/tests/rfc3986/modification/roundtrip_special_case1.phpt @@ -11,10 +11,14 @@ $uri2 = $uri2->withHost(null); var_dump($uri1->getRawPath()); var_dump($uri2->getRawPath()); +var_dump($uri2->toRawString()); var_dump($uri2->getPath()); +var_dump($uri2->toString()); ?> --EXPECT-- string(5) "path1" string(6) "/path1" string(6) "/path1" +string(6) "/path1" +string(6) "/path1" diff --git a/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt b/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt index ded5981c713fd..39e924e778f67 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withScheme("http"); var_dump($uri1->getRawScheme()); var_dump($uri2->getRawScheme()); +var_dump($uri2->toRawString()); var_dump($uri2->getScheme()); +var_dump($uri2->toString()); ?> --EXPECT-- string(5) "https" string(4) "http" +string(18) "http://example.com" string(4) "http" +string(18) "http://example.com" diff --git a/ext/uri/tests/rfc3986/modification/scheme_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/scheme_success_unset_existing.phpt index a5e1cfae75413..67d447e8810e4 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_success_unset_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_success_unset_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withScheme(null); var_dump($uri1->getRawScheme()); var_dump($uri2->getRawScheme()); +var_dump($uri2->toRawString()); var_dump($uri2->getScheme()); +var_dump($uri2->toString()); ?> --EXPECT-- string(5) "https" NULL +string(13) "//example.com" NULL +string(13) "//example.com" diff --git a/ext/uri/tests/rfc3986/modification/scheme_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/scheme_success_unset_non_existent.phpt index 030ae9bd2941b..4aa9b2d9dd2c6 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_success_unset_non_existent.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_success_unset_non_existent.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withScheme(null); var_dump($uri1->getRawScheme()); var_dump($uri2->getRawScheme()); +var_dump($uri2->toRawString()); var_dump($uri2->getScheme()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL NULL +string(8) "/foo/bar" NULL +string(8) "/foo/bar" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_encoded.phpt index 1237efb21e1fb..a4b7409d67063 100644 --- a/ext/uri/tests/rfc3986/modification/userinfo_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_encoded.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withUserInfo("%75s%2Fr:password"); // us/r:password var_dump($uri1->getRawUserInfo()); var_dump($uri2->getRawUserInfo()); +var_dump($uri2->toRawString()); var_dump($uri2->getUserInfo()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL string(17) "%75s%2Fr:password" +string(37) "https://%75s%2Fr:password@example.com" string(15) "us%2Fr:password" +string(35) "https://us%2Fr:password@example.com" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt index e602c80e77b03..a13e091075cb6 100644 --- a/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withUserInfo("user:password"); var_dump($uri1->getRawUserInfo()); var_dump($uri2->getRawUserInfo()); +var_dump($uri2->toRawString()); var_dump($uri2->getUserInfo()); +var_dump($uri2->toString()); ?> --EXPECT-- string(5) ":pass" string(13) "user:password" +string(33) "https://user:password@example.com" string(13) "user:password" +string(33) "https://user:password@example.com" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt index 6e1ec1b4fa3de..dc49c10d7526a 100644 --- a/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_new.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withUserInfo("user:password"); var_dump($uri1->getRawUserInfo()); var_dump($uri2->getRawUserInfo()); +var_dump($uri2->toRawString()); var_dump($uri2->getUserInfo()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL string(13) "user:password" +string(33) "https://user:password@example.com" string(13) "user:password" +string(33) "https://user:password@example.com" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_unset_existing.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_unset_existing.phpt index cc4ccc5687564..0f4e7219cbd35 100644 --- a/ext/uri/tests/rfc3986/modification/userinfo_success_unset_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_unset_existing.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withUserInfo(null); var_dump($uri1->getRawUserInfo()); var_dump($uri2->getRawUserInfo()); +var_dump($uri2->toRawString()); var_dump($uri2->getUserInfo()); +var_dump($uri2->toString()); ?> --EXPECT-- string(13) "user:password" NULL +string(19) "https://example.com" NULL +string(19) "https://example.com" diff --git a/ext/uri/tests/rfc3986/modification/userinfo_success_unset_non_existent.phpt b/ext/uri/tests/rfc3986/modification/userinfo_success_unset_non_existent.phpt index 8c06b667b8bc8..9aa2a5999ac43 100644 --- a/ext/uri/tests/rfc3986/modification/userinfo_success_unset_non_existent.phpt +++ b/ext/uri/tests/rfc3986/modification/userinfo_success_unset_non_existent.phpt @@ -10,10 +10,14 @@ $uri2 = $uri1->withUserInfo(null); var_dump($uri1->getRawUserInfo()); var_dump($uri2->getRawUserInfo()); +var_dump($uri2->toRawString()); var_dump($uri2->getUserInfo()); +var_dump($uri2->toString()); ?> --EXPECT-- NULL NULL +string(8) "/foo/bar" NULL +string(8) "/foo/bar" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_auto_encode.phpt b/ext/uri/tests/whatwg/modification/fragment_success_auto_encode.phpt index cfa4831ea91e3..ac74b8668cd23 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_auto_encode.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_auto_encode.phpt @@ -5,13 +5,15 @@ uri --FILE-- withFragment("<>"); +$url1 = Uri\WhatWg\Url::parse("https://example.com"); +$url2 = $url1->withFragment("<>"); -var_dump($uri1->getFragment()); -var_dump($uri2->getFragment()); +var_dump($url1->getFragment()); +var_dump($url2->getFragment()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(6) "%3C%3E" +string(27) "https://example.com/#%3C%3E" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_empty.phpt b/ext/uri/tests/whatwg/modification/fragment_success_empty.phpt index 9d068f8f9375f..5b3aa9426232c 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_empty.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_empty.phpt @@ -5,13 +5,15 @@ uri --FILE-- withFragment(""); +$url1 = Uri\WhatWg\Url::parse("https://example.com"); +$url2 = $url1->withFragment(""); -var_dump($uri1->getFragment()); -var_dump($uri2->getFragment()); +var_dump($url1->getFragment()); +var_dump($url2->getFragment()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt b/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt index 1a2a2bebf1d19..03aa593805462 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt @@ -5,13 +5,15 @@ uri --FILE-- withFragment("foo%3dbar"); // foo=bar +$url1 = Uri\WhatWg\Url::parse("https://example.com"); +$url2 = $url1->withFragment("foo%3dbar"); // foo=bar -var_dump($uri1->getFragment()); -var_dump($uri2->getFragment()); +var_dump($url1->getFragment()); +var_dump($url2->getFragment()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(9) "foo%3dbar" +string(30) "https://example.com/#foo%3dbar" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_existing.phpt b/ext/uri/tests/whatwg/modification/fragment_success_existing.phpt index 31f20ce70b0e2..0a7d253434d41 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_existing.phpt @@ -5,13 +5,15 @@ uri --FILE-- withFragment("bar"); +$url1 = Uri\WhatWg\Url::parse("https://example.com#foo"); +$url2 = $url1->withFragment("bar"); -var_dump($uri1->getFragment()); -var_dump($uri2->getFragment()); +var_dump($url1->getFragment()); +var_dump($url2->getFragment()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(3) "foo" string(3) "bar" +string(24) "https://example.com/#bar" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_unicode.phpt b/ext/uri/tests/whatwg/modification/fragment_success_unicode.phpt index 06575390100e3..c609b5df042de 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_unicode.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_unicode.phpt @@ -5,13 +5,15 @@ uri --FILE-- withFragment("ő"); +$url1 = Uri\WhatWg\Url::parse("https://example.com"); +$url2 = $url1->withFragment("ő"); -var_dump($uri1->getFragment()); -var_dump($uri2->getFragment()); +var_dump($url1->getFragment()); +var_dump($url2->getFragment()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(6) "%C5%91" +string(27) "https://example.com/#%C5%91" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/fragment_success_unset_existing.phpt index 9a920f8b1feed..585707e497e5c 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_unset_existing.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_unset_existing.phpt @@ -5,13 +5,15 @@ uri --FILE-- withFragment(null); +$url1 = Uri\WhatWg\Url::parse("https://example.com#foo"); +$url2 = $url1->withFragment(null); -var_dump($uri1->getFragment()); -var_dump($uri2->getFragment()); +var_dump($url1->getFragment()); +var_dump($url2->getFragment()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(3) "foo" NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/fragment_success_unset_non_existent.phpt index e159af5e8fea4..21e295db23ec2 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_unset_non_existent.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_unset_non_existent.phpt @@ -5,13 +5,15 @@ uri --FILE-- withFragment(null); +$url1 = Uri\WhatWg\Url::parse("https://example.com"); +$url2 = $url1->withFragment(null); -var_dump($uri1->getFragment()); -var_dump($uri2->getFragment()); +var_dump($url1->getFragment()); +var_dump($url2->getFragment()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_with_leading_hashmark.phpt b/ext/uri/tests/whatwg/modification/fragment_success_with_leading_hashmark.phpt index 540014ee47406..4523388223b68 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_with_leading_hashmark.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_with_leading_hashmark.phpt @@ -5,13 +5,15 @@ uri --FILE-- withFragment("#fragment"); +$url1 = Uri\WhatWg\Url::parse("https://example.com"); +$url2 = $url1->withFragment("#fragment"); -var_dump($uri1->getFragment()); -var_dump($uri2->getFragment()); +var_dump($url1->getFragment()); +var_dump($url2->getFragment()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(8) "fragment" +string(29) "https://example.com/#fragment" diff --git a/ext/uri/tests/whatwg/modification/host_success_encoded.phpt b/ext/uri/tests/whatwg/modification/host_success_encoded.phpt index bc7e583d13222..72008c19b89fe 100644 --- a/ext/uri/tests/whatwg/modification/host_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/host_success_encoded.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withHost("t%65st.com"); // test.com var_dump($url1->getAsciiHost()); var_dump($url2->getAsciiHost()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(11) "example.com" string(8) "test.com" +string(17) "https://test.com/" diff --git a/ext/uri/tests/whatwg/modification/host_success_existing.phpt b/ext/uri/tests/whatwg/modification/host_success_existing.phpt index f26c1b33461d5..a8ad1cffae75c 100644 --- a/ext/uri/tests/whatwg/modification/host_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/host_success_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withHost("test.com"); var_dump($url1->getAsciiHost()); var_dump($url2->getAsciiHost()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(11) "example.com" string(8) "test.com" +string(17) "https://test.com/" diff --git a/ext/uri/tests/whatwg/modification/host_success_idna.phpt b/ext/uri/tests/whatwg/modification/host_success_idna.phpt index 040a984cd97ef..919e22934dfa2 100644 --- a/ext/uri/tests/whatwg/modification/host_success_idna.phpt +++ b/ext/uri/tests/whatwg/modification/host_success_idna.phpt @@ -10,10 +10,14 @@ $url2 = $url1->withHost("éxämple.com"); var_dump($url1->getAsciiHost()); var_dump($url2->getAsciiHost()); +var_dump($url2->toAsciiString()); var_dump($url2->getUnicodeHost()); +var_dump($url2->toUnicodeString()); ?> --EXPECT-- string(11) "example.com" string(19) "xn--xmple-gra7a.com" +string(28) "https://xn--xmple-gra7a.com/" string(13) "éxämple.com" +string(22) "https://éxämple.com/" diff --git a/ext/uri/tests/whatwg/modification/host_success_ipv4.phpt b/ext/uri/tests/whatwg/modification/host_success_ipv4.phpt index 9ea87840325d9..fef9e0fc63761 100644 --- a/ext/uri/tests/whatwg/modification/host_success_ipv4.phpt +++ b/ext/uri/tests/whatwg/modification/host_success_ipv4.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withHost("192.168.0.1"); var_dump($url1->getAsciiHost()); var_dump($url2->getAsciiHost()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(11) "example.com" string(11) "192.168.0.1" +string(20) "https://192.168.0.1/" diff --git a/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt b/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt index dce80fcfe9cf1..2124b70ef56d7 100644 --- a/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt +++ b/ext/uri/tests/whatwg/modification/host_success_ipv6.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withHost("[2001:0db8:3333:4444:5555:6666:7777:8888]"); var_dump($url1->getAsciiHost()); var_dump($url2->getAsciiHost()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(11) "example.com" string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" +string(49) "https://[2001:db8:3333:4444:5555:6666:7777:8888]/" diff --git a/ext/uri/tests/whatwg/modification/password_success_auto_encoded.phpt b/ext/uri/tests/whatwg/modification/password_success_auto_encoded.phpt index cf4cf89e0bb37..5db68cb90a622 100644 --- a/ext/uri/tests/whatwg/modification/password_success_auto_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/password_success_auto_encoded.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPassword("p:s/"); var_dump($url1->getPassword()); var_dump($url2->getPassword()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(8) "password" string(8) "p%3As%2F" +string(34) "https://user:p%3As%2F@example.com/" diff --git a/ext/uri/tests/whatwg/modification/password_success_encoded.phpt b/ext/uri/tests/whatwg/modification/password_success_encoded.phpt index e4b607182c7f5..82b172d914af1 100644 --- a/ext/uri/tests/whatwg/modification/password_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/password_success_encoded.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPassword("p%61ssword"); var_dump($url1->getPassword()); var_dump($url2->getPassword()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(10) "p%61ssword" +string(32) "https://:p%61ssword@example.com/" diff --git a/ext/uri/tests/whatwg/modification/password_success_existing.phpt b/ext/uri/tests/whatwg/modification/password_success_existing.phpt index f472a8e455fed..9c1a38be30055 100644 --- a/ext/uri/tests/whatwg/modification/password_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/password_success_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPassword("password"); var_dump($url1->getPassword()); var_dump($url2->getPassword()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(8) "password" +string(30) "https://:password@example.com/" diff --git a/ext/uri/tests/whatwg/modification/password_success_new.phpt b/ext/uri/tests/whatwg/modification/password_success_new.phpt index 1fa4d55dacb21..8357b9972109d 100644 --- a/ext/uri/tests/whatwg/modification/password_success_new.phpt +++ b/ext/uri/tests/whatwg/modification/password_success_new.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPassword("password"); var_dump($url1->getPassword()); var_dump($url2->getPassword()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(8) "password" +string(30) "https://:password@example.com/" diff --git a/ext/uri/tests/whatwg/modification/password_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/password_success_unset_existing.phpt index ca414fdc47063..59ea81bc152d9 100644 --- a/ext/uri/tests/whatwg/modification/password_success_unset_existing.phpt +++ b/ext/uri/tests/whatwg/modification/password_success_unset_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPassword(null); var_dump($url1->getPassword()); var_dump($url2->getPassword()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(8) "password" NULL +string(29) "https://username@example.com/" diff --git a/ext/uri/tests/whatwg/modification/password_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/password_success_unset_non_existent.phpt index a6f834ac3bfbf..95649f6edfc43 100644 --- a/ext/uri/tests/whatwg/modification/password_success_unset_non_existent.phpt +++ b/ext/uri/tests/whatwg/modification/password_success_unset_non_existent.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPassword(null); var_dump($url1->getPassword()); var_dump($url2->getPassword()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/path_success_auto_encoded.phpt b/ext/uri/tests/whatwg/modification/path_success_auto_encoded.phpt index b05829b52c9ce..59f539124c68b 100644 --- a/ext/uri/tests/whatwg/modification/path_success_auto_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/path_success_auto_encoded.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPath("/p^th#"); var_dump($url1->getPath()); var_dump($url2->getPath()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(1) "/" string(8) "/p^th%23" +string(27) "https://example.com/p^th%23" diff --git a/ext/uri/tests/whatwg/modification/path_success_empty.phpt b/ext/uri/tests/whatwg/modification/path_success_empty.phpt index 4b1d66ee85bb1..9e8d3495445a4 100644 --- a/ext/uri/tests/whatwg/modification/path_success_empty.phpt +++ b/ext/uri/tests/whatwg/modification/path_success_empty.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPath(""); var_dump($url1->getPath()); var_dump($url2->getPath()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(1) "/" string(1) "/" +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/path_success_encoded.phpt b/ext/uri/tests/whatwg/modification/path_success_encoded.phpt index 618ac7fee7bb8..cb4e78610f734 100644 --- a/ext/uri/tests/whatwg/modification/path_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/path_success_encoded.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPath("/foo%2Fbar"); // /foo/bar var_dump($url1->getPath()); var_dump($url2->getPath()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(1) "/" string(10) "/foo%2Fbar" +string(29) "https://example.com/foo%2Fbar" diff --git a/ext/uri/tests/whatwg/modification/path_success_existing.phpt b/ext/uri/tests/whatwg/modification/path_success_existing.phpt index 9af49ad7e98e9..113c8c88d48bd 100644 --- a/ext/uri/tests/whatwg/modification/path_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/path_success_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPath("/baz"); var_dump($url1->getPath()); var_dump($url2->getPath()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(8) "/foo/bar" string(4) "/baz" +string(23) "https://example.com/baz" diff --git a/ext/uri/tests/whatwg/modification/path_success_unicode.phpt b/ext/uri/tests/whatwg/modification/path_success_unicode.phpt index 6f454556f5ec9..d195a6dadbc18 100644 --- a/ext/uri/tests/whatwg/modification/path_success_unicode.phpt +++ b/ext/uri/tests/whatwg/modification/path_success_unicode.phpt @@ -10,7 +10,9 @@ $url2 = $url1->withPath("/ő"); var_dump($url1->getPath()); var_dump($url2->getPath()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(1) "/" string(7) "/%C5%91" +string(26) "https://example.com/%C5%91" diff --git a/ext/uri/tests/whatwg/modification/path_success_without_leading_slash.phpt b/ext/uri/tests/whatwg/modification/path_success_without_leading_slash.phpt index 2fa9a13973d56..1149287dc5319 100644 --- a/ext/uri/tests/whatwg/modification/path_success_without_leading_slash.phpt +++ b/ext/uri/tests/whatwg/modification/path_success_without_leading_slash.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPath("foo/bar"); var_dump($url1->getPath()); var_dump($url2->getPath()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(1) "/" string(8) "/foo/bar" +string(27) "https://example.com/foo/bar" diff --git a/ext/uri/tests/whatwg/modification/port_success_existing.phpt b/ext/uri/tests/whatwg/modification/port_success_existing.phpt index 85118b85a4c1c..e5ea806bd1a40 100644 --- a/ext/uri/tests/whatwg/modification/port_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/port_success_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPort(443); var_dump($url1->getPort()); var_dump($url2->getPort()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- int(80) int(443) +string(24) "scheme://example.com:443" diff --git a/ext/uri/tests/whatwg/modification/port_success_new.phpt b/ext/uri/tests/whatwg/modification/port_success_new.phpt index 4825447cf2c05..85098b21b7b32 100644 --- a/ext/uri/tests/whatwg/modification/port_success_new.phpt +++ b/ext/uri/tests/whatwg/modification/port_success_new.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPort(443); var_dump($url1->getPort()); var_dump($url2->getPort()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL int(443) +string(24) "scheme://example.com:443" diff --git a/ext/uri/tests/whatwg/modification/port_success_special1.phpt b/ext/uri/tests/whatwg/modification/port_success_special1.phpt index 65867d798eead..ba85449e43536 100644 --- a/ext/uri/tests/whatwg/modification/port_success_special1.phpt +++ b/ext/uri/tests/whatwg/modification/port_success_special1.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPort(80); var_dump($url1->getPort()); var_dump($url2->getPort()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- int(88) NULL +string(19) "http://example.com/" diff --git a/ext/uri/tests/whatwg/modification/port_success_special2.phpt b/ext/uri/tests/whatwg/modification/port_success_special2.phpt index f6f6e9e9d9f1b..d9f0074f05329 100644 --- a/ext/uri/tests/whatwg/modification/port_success_special2.phpt +++ b/ext/uri/tests/whatwg/modification/port_success_special2.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPort(443); var_dump($url1->getPort()); var_dump($url2->getPort()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/port_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/port_success_unset_existing.phpt index 0080cc3ec3727..c280c181b19a4 100644 --- a/ext/uri/tests/whatwg/modification/port_success_unset_existing.phpt +++ b/ext/uri/tests/whatwg/modification/port_success_unset_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPort(null); var_dump($url1->getPort()); var_dump($url2->getPort()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- int(80) NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/port_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/port_success_unset_non_existent.phpt index ab56107708f20..d364c72d7002b 100644 --- a/ext/uri/tests/whatwg/modification/port_success_unset_non_existent.phpt +++ b/ext/uri/tests/whatwg/modification/port_success_unset_non_existent.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withPort(null); var_dump($url2->getPort()); var_dump($url2->getPort()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL NULL +string(18) "ftp://example.com/" diff --git a/ext/uri/tests/whatwg/modification/query_success_auto_encoded.phpt b/ext/uri/tests/whatwg/modification/query_success_auto_encoded.phpt index efe20f6893cd2..fc487f33797d5 100644 --- a/ext/uri/tests/whatwg/modification/query_success_auto_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_auto_encoded.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery("#foo "); var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(9) "%23foo%20" +string(30) "https://example.com/?%23foo%20" diff --git a/ext/uri/tests/whatwg/modification/query_success_context_senstivie_reserved.phpt b/ext/uri/tests/whatwg/modification/query_success_context_senstivie_reserved.phpt index 76394fa6926e0..cb220a0a33ef3 100644 --- a/ext/uri/tests/whatwg/modification/query_success_context_senstivie_reserved.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_context_senstivie_reserved.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery("?foo=bar"); var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(7) "foo=bar" +string(28) "https://example.com/?foo=bar" diff --git a/ext/uri/tests/whatwg/modification/query_success_empty.phpt b/ext/uri/tests/whatwg/modification/query_success_empty.phpt index 730f557f73c57..dcb98bc37689d 100644 --- a/ext/uri/tests/whatwg/modification/query_success_empty.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_empty.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery(""); var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/query_success_encoded.phpt b/ext/uri/tests/whatwg/modification/query_success_encoded.phpt index 8b95aa68976c6..60a55138ec8c8 100644 --- a/ext/uri/tests/whatwg/modification/query_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_encoded.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery("foo%3dbar"); // foo=bar var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(9) "foo%3dbar" +string(30) "https://example.com/?foo%3dbar" diff --git a/ext/uri/tests/whatwg/modification/query_success_existing.phpt b/ext/uri/tests/whatwg/modification/query_success_existing.phpt index 6d40087472051..b3429b58b8651 100644 --- a/ext/uri/tests/whatwg/modification/query_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery("foo=bar&baz=qux"); var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(7) "foo=bar" string(15) "foo=bar&baz=qux" +string(36) "https://example.com/?foo=bar&baz=qux" diff --git a/ext/uri/tests/whatwg/modification/query_success_unicode.phpt b/ext/uri/tests/whatwg/modification/query_success_unicode.phpt index 825d463fdfdd9..526138f8954af 100644 --- a/ext/uri/tests/whatwg/modification/query_success_unicode.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_unicode.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery("ő"); var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(6) "%C5%91" +string(27) "https://example.com/?%C5%91" diff --git a/ext/uri/tests/whatwg/modification/query_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/query_success_unset_existing.phpt index 5afb3cfef61be..cb5a2a701e24a 100644 --- a/ext/uri/tests/whatwg/modification/query_success_unset_existing.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_unset_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery(null); var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(7) "foo=bar" NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/query_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/query_success_unset_non_existent.phpt index fe403a98c597f..6456dcacac7f9 100644 --- a/ext/uri/tests/whatwg/modification/query_success_unset_non_existent.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_unset_non_existent.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery(null); var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL NULL +string(20) "https://example.com/" diff --git a/ext/uri/tests/whatwg/modification/query_success_with_leading_question_mark.phpt b/ext/uri/tests/whatwg/modification/query_success_with_leading_question_mark.phpt index 8a27480f3c1b7..ce67dcb6bb352 100644 --- a/ext/uri/tests/whatwg/modification/query_success_with_leading_question_mark.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_with_leading_question_mark.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withQuery("?foo=bar"); var_dump($url1->getQuery()); var_dump($url2->getQuery()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(7) "foo=bar" +string(35) "https://example.com/foo/bar?foo=bar" diff --git a/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt b/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt index 61b8c82a885bb..5104bd997de25 100644 --- a/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt +++ b/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withScheme("http"); var_dump($url1->getScheme()); var_dump($url2->getScheme()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(5) "https" string(4) "http" +string(19) "http://example.com/" diff --git a/ext/uri/tests/whatwg/modification/scheme_success_colon.phpt b/ext/uri/tests/whatwg/modification/scheme_success_colon.phpt index abde11ab58f5b..052eca6e247b0 100644 --- a/ext/uri/tests/whatwg/modification/scheme_success_colon.phpt +++ b/ext/uri/tests/whatwg/modification/scheme_success_colon.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withScheme("http:"); var_dump($url1->getScheme()); var_dump($url2->getScheme()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(5) "https" string(4) "http" +string(19) "http://example.com/" diff --git a/ext/uri/tests/whatwg/modification/scheme_success_full.phpt b/ext/uri/tests/whatwg/modification/scheme_success_full.phpt index b849a5f44be04..957a1fab7aff2 100644 --- a/ext/uri/tests/whatwg/modification/scheme_success_full.phpt +++ b/ext/uri/tests/whatwg/modification/scheme_success_full.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withScheme("http://"); var_dump($url1->getScheme()); var_dump($url2->getScheme()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(5) "https" string(4) "http" +string(19) "http://example.com/" diff --git a/ext/uri/tests/whatwg/modification/username_success_auto_encoded.phpt b/ext/uri/tests/whatwg/modification/username_success_auto_encoded.phpt index 2636c31c2e544..bc0beab496495 100644 --- a/ext/uri/tests/whatwg/modification/username_success_auto_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/username_success_auto_encoded.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withUsername("u:s/r"); var_dump($url1->getUsername()); var_dump($url2->getUsername()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(4) "user" string(9) "u%3As%2Fr" +string(39) "https://u%3As%2Fr:password@example.com/" diff --git a/ext/uri/tests/whatwg/modification/username_success_existing.phpt b/ext/uri/tests/whatwg/modification/username_success_existing.phpt index 5a247ae903a1b..83093ee63fc01 100644 --- a/ext/uri/tests/whatwg/modification/username_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/username_success_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withUsername("username"); var_dump($url1->getUsername()); var_dump($url2->getUsername()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(8) "username" +string(29) "https://username@example.com/" diff --git a/ext/uri/tests/whatwg/modification/username_success_new.phpt b/ext/uri/tests/whatwg/modification/username_success_new.phpt index e95089091c0f4..56666a68ea7d2 100644 --- a/ext/uri/tests/whatwg/modification/username_success_new.phpt +++ b/ext/uri/tests/whatwg/modification/username_success_new.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withUsername("username"); var_dump($url1->getUsername()); var_dump($url2->getUsername()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL string(8) "username" +string(29) "https://username@example.com/" diff --git a/ext/uri/tests/whatwg/modification/username_success_unset_existing.phpt b/ext/uri/tests/whatwg/modification/username_success_unset_existing.phpt index 1243ad7dc48a6..f71deff3f207b 100644 --- a/ext/uri/tests/whatwg/modification/username_success_unset_existing.phpt +++ b/ext/uri/tests/whatwg/modification/username_success_unset_existing.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withUsername(null); var_dump($url1->getUsername()); var_dump($url2->getUsername()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- string(8) "username" NULL +string(30) "https://:password@example.com/" diff --git a/ext/uri/tests/whatwg/modification/username_success_unset_non_existent.phpt b/ext/uri/tests/whatwg/modification/username_success_unset_non_existent.phpt index 22f63c3df88a1..44a6486104242 100644 --- a/ext/uri/tests/whatwg/modification/username_success_unset_non_existent.phpt +++ b/ext/uri/tests/whatwg/modification/username_success_unset_non_existent.phpt @@ -10,8 +10,10 @@ $url2 = $url1->withUsername(null); var_dump($url1->getUsername()); var_dump($url2->getUsername()); +var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL NULL +string(20) "https://example.com/" From 98f5282383b553066842df2f401fa95f36017e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sat, 4 Oct 2025 22:43:27 +0200 Subject: [PATCH 4/5] Remove unnecessary test --- .../modification/port_error_overflow.phpt | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 ext/uri/tests/rfc3986/modification/port_error_overflow.phpt diff --git a/ext/uri/tests/rfc3986/modification/port_error_overflow.phpt b/ext/uri/tests/rfc3986/modification/port_error_overflow.phpt deleted file mode 100644 index 05651874fa501..0000000000000 --- a/ext/uri/tests/rfc3986/modification/port_error_overflow.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test Uri\Rfc3986\Uri component modification - port - too large port numbers don't overflow ---EXTENSIONS-- -uri ---FILE-- -withPort(9223372036854775808); - } else { - $uri->withPort(2147483648); - } -} catch (TypeError $e) { - echo $e->getMessage() . "\n"; -} - -?> ---EXPECT-- -Uri\Rfc3986\Uri::withPort(): Argument #1 ($port) must be of type ?int, float given From 48072a6c331f309de6ba64c88db5f250898ad07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 5 Oct 2025 23:06:43 +0200 Subject: [PATCH 5/5] Address review comments --- .../rfc3986/modification/fragment_success_encoded.phpt | 6 +++--- .../rfc3986/modification/host_success_encoded.phpt | 10 +++++----- .../rfc3986/modification/host_success_existing.phpt | 10 +++++----- .../rfc3986/modification/path_success_encoded.phpt | 6 +++--- ...t => query_success_context_sensitive_reserved.phpt} | 0 .../rfc3986/modification/scheme_success_basic.phpt | 6 +++--- .../whatwg/modification/fragment_success_encoded.phpt | 6 +++--- .../whatwg/modification/host_success_encoded.phpt | 6 +++--- .../whatwg/modification/host_success_existing.phpt | 6 +++--- .../whatwg/modification/path_success_encoded.phpt | 6 +++--- .../whatwg/modification/query_success_encoded.phpt | 6 +++--- .../whatwg/modification/scheme_success_basic.phpt | 2 +- 12 files changed, 35 insertions(+), 35 deletions(-) rename ext/uri/tests/rfc3986/modification/{query_success_context_senstive_reserved.phpt => query_success_context_sensitive_reserved.phpt} (100%) diff --git a/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt index 4b6ccb2f7aa31..b1b1081ff81c0 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_success_encoded.phpt @@ -6,7 +6,7 @@ uri withFragment("foo%3dbar"); // foo=bar +$uri2 = $uri1->withFragment("foo%3db%61r"); // foo=bar var_dump($uri1->getRawFragment()); var_dump($uri2->getRawFragment()); @@ -17,7 +17,7 @@ var_dump($uri2->toString()); ?> --EXPECT-- NULL -string(9) "foo%3dbar" -string(29) "https://example.com#foo%3dbar" +string(11) "foo%3db%61r" +string(31) "https://example.com#foo%3db%61r" string(9) "foo%3Dbar" string(29) "https://example.com#foo%3Dbar" diff --git a/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt index 3db01109e1dbb..d9db6003b1572 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_encoded.phpt @@ -6,7 +6,7 @@ uri withHost("t%65st.com"); // test.com +$uri2 = $uri1->withHost("%65xample.net"); // example.net var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); @@ -17,7 +17,7 @@ var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" -string(10) "t%65st.com" -string(18) "https://t%65st.com" -string(8) "test.com" -string(16) "https://test.com" +string(13) "%65xample.net" +string(21) "https://%65xample.net" +string(11) "example.net" +string(19) "https://example.net" diff --git a/ext/uri/tests/rfc3986/modification/host_success_existing.phpt b/ext/uri/tests/rfc3986/modification/host_success_existing.phpt index 140eb60ecad58..f9d3da987abc0 100644 --- a/ext/uri/tests/rfc3986/modification/host_success_existing.phpt +++ b/ext/uri/tests/rfc3986/modification/host_success_existing.phpt @@ -6,7 +6,7 @@ uri withHost("test.com"); +$uri2 = $uri1->withHost("example.net"); var_dump($uri1->getRawHost()); var_dump($uri2->getRawHost()); @@ -17,7 +17,7 @@ var_dump($uri2->toString()); ?> --EXPECT-- string(11) "example.com" -string(8) "test.com" -string(16) "https://test.com" -string(8) "test.com" -string(16) "https://test.com" +string(11) "example.net" +string(19) "https://example.net" +string(11) "example.net" +string(19) "https://example.net" diff --git a/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt b/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt index 7f94ee8fd7d27..05b62cafe2509 100644 --- a/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/path_success_encoded.phpt @@ -6,7 +6,7 @@ uri withPath("/foo%2Fbar"); // /foo/bar +$uri2 = $uri1->withPath("/foo%2Fb%61r"); // /foo/bar var_dump($uri1->getRawPath()); var_dump($uri2->getRawPath()); @@ -17,7 +17,7 @@ var_dump($uri2->toString()); ?> --EXPECT-- string(0) "" -string(10) "/foo%2Fbar" -string(29) "https://example.com/foo%2Fbar" +string(12) "/foo%2Fb%61r" +string(31) "https://example.com/foo%2Fb%61r" string(10) "/foo%2Fbar" string(29) "https://example.com/foo%2Fbar" diff --git a/ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt b/ext/uri/tests/rfc3986/modification/query_success_context_sensitive_reserved.phpt similarity index 100% rename from ext/uri/tests/rfc3986/modification/query_success_context_senstive_reserved.phpt rename to ext/uri/tests/rfc3986/modification/query_success_context_sensitive_reserved.phpt diff --git a/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt b/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt index 39e924e778f67..695cb9c7f1e49 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_success_basic.phpt @@ -6,7 +6,7 @@ uri withScheme("http"); +$uri2 = $uri1->withScheme("HTTP"); var_dump($uri1->getRawScheme()); var_dump($uri2->getRawScheme()); @@ -17,7 +17,7 @@ var_dump($uri2->toString()); ?> --EXPECT-- string(5) "https" -string(4) "http" -string(18) "http://example.com" +string(4) "HTTP" +string(18) "HTTP://example.com" string(4) "http" string(18) "http://example.com" diff --git a/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt b/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt index 03aa593805462..9473ea9535f96 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_encoded.phpt @@ -6,7 +6,7 @@ uri withFragment("foo%3dbar"); // foo=bar +$url2 = $url1->withFragment("foo%3db%61r"); // foo=bar var_dump($url1->getFragment()); var_dump($url2->getFragment()); @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL -string(9) "foo%3dbar" -string(30) "https://example.com/#foo%3dbar" +string(11) "foo%3db%61r" +string(32) "https://example.com/#foo%3db%61r" diff --git a/ext/uri/tests/whatwg/modification/host_success_encoded.phpt b/ext/uri/tests/whatwg/modification/host_success_encoded.phpt index 72008c19b89fe..9604476554fc8 100644 --- a/ext/uri/tests/whatwg/modification/host_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/host_success_encoded.phpt @@ -6,7 +6,7 @@ uri withHost("t%65st.com"); // test.com +$url2 = $url1->withHost("%65xample.net"); // example.net var_dump($url1->getAsciiHost()); var_dump($url2->getAsciiHost()); @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString()); ?> --EXPECT-- string(11) "example.com" -string(8) "test.com" -string(17) "https://test.com/" +string(11) "example.net" +string(20) "https://example.net/" diff --git a/ext/uri/tests/whatwg/modification/host_success_existing.phpt b/ext/uri/tests/whatwg/modification/host_success_existing.phpt index a8ad1cffae75c..57394c851c775 100644 --- a/ext/uri/tests/whatwg/modification/host_success_existing.phpt +++ b/ext/uri/tests/whatwg/modification/host_success_existing.phpt @@ -6,7 +6,7 @@ uri withHost("test.com"); +$url2 = $url1->withHost("example.net"); var_dump($url1->getAsciiHost()); var_dump($url2->getAsciiHost()); @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString()); ?> --EXPECT-- string(11) "example.com" -string(8) "test.com" -string(17) "https://test.com/" +string(11) "example.net" +string(20) "https://example.net/" diff --git a/ext/uri/tests/whatwg/modification/path_success_encoded.phpt b/ext/uri/tests/whatwg/modification/path_success_encoded.phpt index cb4e78610f734..b698c4691b0ca 100644 --- a/ext/uri/tests/whatwg/modification/path_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/path_success_encoded.phpt @@ -6,7 +6,7 @@ uri withPath("/foo%2Fbar"); // /foo/bar +$url2 = $url1->withPath("/foo%2Fb%61r"); // /foo/bar var_dump($url1->getPath()); var_dump($url2->getPath()); @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString()); ?> --EXPECT-- string(1) "/" -string(10) "/foo%2Fbar" -string(29) "https://example.com/foo%2Fbar" +string(12) "/foo%2Fb%61r" +string(31) "https://example.com/foo%2Fb%61r" diff --git a/ext/uri/tests/whatwg/modification/query_success_encoded.phpt b/ext/uri/tests/whatwg/modification/query_success_encoded.phpt index 60a55138ec8c8..f9935015f7bd7 100644 --- a/ext/uri/tests/whatwg/modification/query_success_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_encoded.phpt @@ -6,7 +6,7 @@ uri withQuery("foo%3dbar"); // foo=bar +$url2 = $url1->withQuery("foo%3db%61r"); // foo=bar var_dump($url1->getQuery()); var_dump($url2->getQuery()); @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL -string(9) "foo%3dbar" -string(30) "https://example.com/?foo%3dbar" +string(11) "foo%3db%61r" +string(32) "https://example.com/?foo%3db%61r" diff --git a/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt b/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt index 5104bd997de25..6f66b30b2b7b4 100644 --- a/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt +++ b/ext/uri/tests/whatwg/modification/scheme_success_basic.phpt @@ -6,7 +6,7 @@ uri withScheme("http"); +$url2 = $url1->withScheme("HTTP"); var_dump($url1->getScheme()); var_dump($url2->getScheme());