--TEST--
DOMNode::C14N()
--EXTENSIONS--
dom
--FILE--
The Grapes of Wrath
John Steinbeck
The Pearl
John Steinbeck
XML;
$doc = new DOMDocument();
$doc->loadXML($xml);
$node = $doc->getElementsByTagName('title')->item(0);
var_dump($node->C14N());
try {
var_dump($node->C14N(false, false, []));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
var_dump($node->C14N(false, false, ['query' => []]));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
string(34) "
The Grapes of Wrath"
DOMNode::C14N(): Argument #3 ($xpath) must have a "query" key
DOMNode::C14N(): Argument #3 ($xpath) "query" option must be a string, array given