php-src/ext/xmlreader/tests/fromString_custom_constructor_error.phpt

20 lines
354 B
PHP

--TEST--
XMLReader::fromString() - custom constructor with error
--EXTENSIONS--
xmlreader
--FILE--
<?php
class CustomXMLReader extends XMLReader {
public function __construct() {
throw new Error('nope');
}
}
try {
CustomXMLReader::fromString("<root/>");
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
nope