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