Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withFragment("#fragment");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified fragment is malformed
Uri\InvalidUriException: The specified fragment is malformed
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withFragment("ő");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified fragment is malformed
Uri\InvalidUriException: The specified fragment is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/rfc3986/modification/host_error_reserved.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withHost("ex#mple.com");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified host is malformed
Uri\InvalidUriException: The specified host is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/rfc3986/modification/path_error_reserved.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withPath("/[foo]");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified path is malformed
Uri\InvalidUriException: The specified path is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/rfc3986/modification/path_error_unicode.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withPath("/ő");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified path is malformed
Uri\InvalidUriException: The specified path is malformed
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withPath("foo");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified path is malformed
Uri\InvalidUriException: The specified path is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/rfc3986/modification/port_error_negative.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withPort(-1);
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified port is malformed
Uri\InvalidUriException: The specified port is malformed
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withQuery("#foo");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified query is malformed
Uri\InvalidUriException: The specified query is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/rfc3986/modification/query_error_unicode.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withQuery("ő");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified query is malformed
Uri\InvalidUriException: The specified query is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withScheme("");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified scheme is malformed
Uri\InvalidUriException: The specified scheme is malformed
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withScheme("http%73");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified scheme is malformed
Uri\InvalidUriException: The specified scheme is malformed
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withScheme("https:");
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified scheme is malformed
Uri\InvalidUriException: The specified scheme is malformed
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com");

try {
$uri->withUserInfo("us/r:password"); // us/r:password
} catch (Uri\InvalidUriException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified userinfo is malformed
Uri\InvalidUriException: The specified userinfo is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/whatwg/modification/host_error_empty.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url->withHost("");
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified host is malformed (HostMissing)
Uri\WhatWg\InvalidUrlException: The specified host is malformed (HostMissing)
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("foo://example.com");

try {
$url = $url->withHost("[email protected]");
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified host is malformed (HostInvalidCodePoint)
Uri\WhatWg\InvalidUrlException: The specified host is malformed (HostInvalidCodePoint)
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url = $url->withHost("[email protected]");
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified host is malformed (DomainInvalidCodePoint)
Uri\WhatWg\InvalidUrlException: The specified host is malformed (DomainInvalidCodePoint)
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url = $url->withHost("ex:mple.com");
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified host is malformed
Uri\WhatWg\InvalidUrlException: The specified host is malformed
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url = $url->withHost("ex:mple.com");
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified host is malformed
Uri\WhatWg\InvalidUrlException: The specified host is malformed
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url = $url->withHost(null);
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified host is malformed (HostMissing)
Uri\WhatWg\InvalidUrlException: The specified host is malformed (HostMissing)
6 changes: 3 additions & 3 deletions ext/uri/tests/whatwg/modification/port_error_negative.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url->withPort(-1);
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified port is malformed
Uri\WhatWg\InvalidUrlException: The specified port is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/whatwg/modification/port_error_too_large.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url->withPort(65536);
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified port is malformed (PortOutOfRange)
Uri\WhatWg\InvalidUrlException: The specified port is malformed (PortOutOfRange)
6 changes: 3 additions & 3 deletions ext/uri/tests/whatwg/modification/scheme_error_empty.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url->withScheme("");
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified scheme is malformed
Uri\WhatWg\InvalidUrlException: The specified scheme is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url->withScheme("http%73");
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified scheme is malformed
Uri\WhatWg\InvalidUrlException: The specified scheme is malformed
6 changes: 3 additions & 3 deletions ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $url = Uri\WhatWg\Url::parse("https://example.com");

try {
$url->withScheme("http?");
} catch (Uri\WhatWg\InvalidUrlException $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
The specified scheme is malformed
Uri\WhatWg\InvalidUrlException: The specified scheme is malformed