php-src/ext/xsl/tests/xsltprocessor_importStylesheet-invalidparam.phpt
Niels Dossche 4bd63568fb
Fix argument type of simplexml_import_dom (#13170)
It needs to be "object".
This is because first- and third-party extension can register custom
node types using `php_libxml_register_export`. So we don't know upfront
what types can be expected.

This also changes the error to a TypeError everywhere.
2024-01-18 20:28:01 +01:00

18 lines
377 B
PHP

--TEST--
XSLTProcessor::importStylesheet() - Test with invalid stylesheet
--EXTENSIONS--
xsl
--FILE--
<?php
$xslt = new XSLTProcessor();
$dummy = new stdClass();
try {
var_dump($xslt->importStylesheet($dummy));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
XSLTProcessor::importStylesheet(): Argument #1 ($stylesheet) must be a valid XML node