Skip to content
Open
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
2 changes: 1 addition & 1 deletion ext/xml/tests/bug78563.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ try {
$parser = xml_parser_create();
clone $parser;
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
Expand Down
12 changes: 6 additions & 6 deletions ext/xml/tests/gh15868.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ xml_set_element_handler($parser,
try {
xml_parse_into_struct($parser, "<container/>", $values, $tags);
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

$parser = xml_parser_create();
Expand All @@ -27,7 +27,7 @@ xml_set_element_handler($parser,
try {
xml_parse_into_struct($parser, "<container/>", $values, $tags);
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

$parser = xml_parser_create();
Expand All @@ -37,10 +37,10 @@ xml_set_character_data_handler($parser, function() {
try {
xml_parse_into_struct($parser, "<root><![CDATA[x]]></root>", $values, $tags);
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
stop 1
stop 2
stop 3
Error: stop 1
Error: stop 2
Error: stop 3
4 changes: 2 additions & 2 deletions ext/xml/tests/xml_parser_get_option_variation4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $xmlParser = xml_parser_create();
try {
xml_parser_get_option ($xmlParser, 42);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

?>
--EXPECT--
xml_parser_get_option(): Argument #2 ($option) must be a XML_OPTION_* constant
ValueError: xml_parser_get_option(): Argument #2 ($option) must be a XML_OPTION_* constant
18 changes: 9 additions & 9 deletions ext/xml/tests/xml_parser_set_option_errors.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ echo "Case folding\n";
try {
xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, []);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, new stdClass());
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

echo "Skip Whitespace\n";
try {
xml_parser_set_option($xmlParser, XML_OPTION_SKIP_WHITE, []);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
xml_parser_set_option($xmlParser, XML_OPTION_SKIP_WHITE, new stdClass());
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

echo "Tag Start\n";
Expand All @@ -42,17 +42,17 @@ echo "Encodings\n";
try {
xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'Invalid Encoding');
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, []);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, new stdClass());
} catch (Error $exception) {
echo $exception::class, ': ', $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

?>
Expand All @@ -77,12 +77,12 @@ Warning: xml_parser_set_option(): Argument #3 ($value) must be of type string|in

Warning: Object of class stdClass could not be converted to int in %s on line %d
Encodings
xml_parser_set_option(): Argument #3 ($value) is not a supported target encoding
ValueError: xml_parser_set_option(): Argument #3 ($value) is not a supported target encoding

Warning: xml_parser_set_option(): Argument #3 ($value) must be of type string|int|bool, array given in %s on line %d

Warning: Array to string conversion in %s on line %d
xml_parser_set_option(): Argument #3 ($value) is not a supported target encoding
ValueError: xml_parser_set_option(): Argument #3 ($value) is not a supported target encoding

Warning: xml_parser_set_option(): Argument #3 ($value) must be of type string|int|bool, stdClass given in %s on line %d
Error: Object of class stdClass could not be converted to string
4 changes: 2 additions & 2 deletions ext/xml/tests/xml_parser_set_option_nonexistent_option.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $xmlParser = xml_parser_create();
try {
xml_parser_set_option($xmlParser, 42, 1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

?>
--EXPECT--
xml_parser_set_option(): Argument #2 ($option) must be a XML_OPTION_* constant
ValueError: xml_parser_set_option(): Argument #2 ($option) must be a XML_OPTION_* constant
Loading