Skip to content

Commit efecd53

Browse files
committed
Change exception printing
1 parent 99cbded commit efecd53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+121
-121
lines changed

ext/uri/tests/rfc3986/parsing/basic_error_multibyte.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Test Uri\Rfc3986\Uri parsing - basic - multibyte character
55

66
try {
77
new Uri\Rfc3986\Uri("🐘");
8-
} catch (Uri\InvalidUriException $e) {
9-
echo $e->getMessage() . "\n";
8+
} catch (Throwable $e) {
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
The specified URI is malformed
14+
Uri\InvalidUriException: The specified URI is malformed

ext/uri/tests/rfc3986/parsing/basic_error_null_byte1.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Test Uri\Rfc3986\Uri parsing - basic - URI contains null byte
66
try {
77
new Uri\Rfc3986\Uri("https://exam\0ple.com");
88
} catch (ValueError $e) {
9-
echo $e->getMessage() . "\n";
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
Uri\Rfc3986\Uri::__construct(): Argument #1 ($uri) must not contain any null bytes
14+
ValueError: Uri\Rfc3986\Uri::__construct(): Argument #1 ($uri) must not contain any null bytes

ext/uri/tests/rfc3986/parsing/basic_error_null_byte2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Test Uri\Rfc3986\Uri parsing - basic - URI contains null byte
66
try {
77
Uri\Rfc3986\Uri::parse("https://exam\0ple.com");
88
} catch (ValueError $e) {
9-
echo $e->getMessage() . "\n";
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
Uri\Rfc3986\Uri::parse(): Argument #1 ($uri) must not contain any null bytes
14+
ValueError: Uri\Rfc3986\Uri::parse(): Argument #1 ($uri) must not contain any null bytes

ext/uri/tests/rfc3986/parsing/host_error_multibyte.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Test Uri\Rfc3986\Uri parsing - host - multibyte character
55

66
try {
77
new Uri\Rfc3986\Uri("https://exḁmple.com");
8-
} catch (Uri\InvalidUriException $e) {
9-
echo $e->getMessage() . "\n";
8+
} catch (Throwable $e) {
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
The specified URI is malformed
14+
Uri\InvalidUriException: The specified URI is malformed

ext/uri/tests/rfc3986/parsing/host_error_reserved.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Test Uri\Rfc3986\Uri parsing - host - reserved character
55

66
try {
77
new Uri\Rfc3986\Uri("https://ex[a]mple.com");
8-
} catch (Uri\InvalidUriException $e) {
9-
echo $e->getMessage() . "\n";
8+
} catch (Throwable $e) {
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
The specified URI is malformed
14+
Uri\InvalidUriException: The specified URI is malformed

ext/uri/tests/rfc3986/parsing/path_error_multibyte.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Test Uri\Rfc3986\Uri parsing - path - multibyte character
55

66
try {
77
new Uri\Rfc3986\Uri("https://example.com/fȎȎ");
8-
} catch (Uri\InvalidUriException $e) {
9-
echo $e->getMessage() . "\n";
8+
} catch (Throwable $e) {
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
The specified URI is malformed
14+
Uri\InvalidUriException: The specified URI is malformed

ext/uri/tests/rfc3986/parsing/path_error_reserved.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Test Uri\Rfc3986\Uri parsing - path - reserved character
55

66
try {
77
new Uri\Rfc3986\Uri("https://example.com/fo[o/ba]r/");
8-
} catch (Uri\InvalidUriException $e) {
9-
echo $e->getMessage() . "\n";
8+
} catch (Throwable $e) {
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
The specified URI is malformed
14+
Uri\InvalidUriException: The specified URI is malformed

ext/uri/tests/rfc3986/parsing/port_error_multibyte.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Test Uri\Rfc3986\Uri parsing - port - multibyte character
55

66
try {
77
new Uri\Rfc3986\Uri("https://example.com:Ȏ");
8-
} catch (Uri\InvalidUriException $e) {
9-
echo $e->getMessage() . "\n";
8+
} catch (Throwable $e) {
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
The specified URI is malformed
14+
Uri\InvalidUriException: The specified URI is malformed

ext/uri/tests/rfc3986/parsing/port_error_negative.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Test Uri\Rfc3986\Uri parsing - port - negative value
55

66
try {
77
var_dump(new Uri\Rfc3986\Uri("http://example.com:-1"));
8-
} catch (Uri\InvalidUriException $e) {
9-
echo $e->getMessage() . "\n";
8+
} catch (Throwable $e) {
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
The specified URI is malformed
14+
Uri\InvalidUriException: The specified URI is malformed

ext/uri/tests/rfc3986/parsing/port_error_percent_encoded.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Test Uri\Rfc3986\Uri parsing - port - percent encoded character
55

66
try {
77
new Uri\Rfc3986\Uri("https://example.com:%30");
8-
} catch (Uri\InvalidUriException $e) {
9-
echo $e->getMessage() . "\n";
8+
} catch (Throwable $e) {
9+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1010
}
1111

1212
?>
1313
--EXPECT--
14-
The specified URI is malformed
14+
Uri\InvalidUriException: The specified URI is malformed

0 commit comments

Comments
 (0)