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
12 changes: 6 additions & 6 deletions ext/libxml/tests/004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ foreach ($ctxs as $ctx) {
try {
var_dump(libxml_set_streams_context($ctx));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
$dom = new DOMDocument();
var_dump($dom->load(__DIR__.'/test.xml'));
Expand All @@ -28,15 +28,15 @@ echo "Done\n";

?>
--EXPECT--
libxml_set_streams_context(): Argument #1 ($context) must be of type resource, null given
TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, null given
bool(true)
libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given
TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given
bool(true)
libxml_set_streams_context(): Argument #1 ($context) must be of type resource, int given
TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, int given
bool(true)
libxml_set_streams_context(): Argument #1 ($context) must be of type resource, stdClass given
TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, stdClass given
bool(true)
libxml_set_streams_context(): Argument #1 ($context) must be of type resource, array given
TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, array given
bool(true)
NULL
bool(true)
Expand Down
8 changes: 4 additions & 4 deletions ext/libxml/tests/bug63389.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ libxml
try {
libxml_set_streams_context("a");
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
$fp = fopen("php://input", "r");
try {
libxml_set_streams_context($fp);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "okey";
?>
--EXPECT--
libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given
libxml_set_streams_context(): supplied resource is not a valid Stream-Context resource
TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given
TypeError: libxml_set_streams_context(): supplied resource is not a valid Stream-Context resource
okey
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ $r = $dd->loadXML($xml);
try {
var_dump($dd->validate());
} catch (\Throwable $e) {
var_dump($e->getMessage());
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
string(122) "DOMDocument::validate(): The user entity loader callback "Handler::handle" has returned a resource, but it is not a stream"
TypeError: DOMDocument::validate(): The user entity loader callback "Handler::handle" has returned a resource, but it is not a stream
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ var_dump(libxml_set_external_entity_loader(function($a, $b, $c, $d) {}));
try {
var_dump($dd->validate());
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

echo "Done.\n";
?>
--EXPECTF--
bool(true)
Exception: Too few arguments to function {closure:%s:%d}(), 3 passed and exactly 4 expected
ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 3 passed and exactly 4 expected
Done.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ libxml
try {
libxml_set_external_entity_loader('nonexistent_function');
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Exception: libxml_set_external_entity_loader(): Argument #1 ($resolver_function) must be a valid callback or null, function "nonexistent_function" not found or invalid function name
TypeError: libxml_set_external_entity_loader(): Argument #1 ($resolver_function) must be a valid callback or null, function "nonexistent_function" not found or invalid function name
Loading