1--TEST--
2DOMNode::C14NFile()
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$xml = <<< XML
8<?xml version="1.0" ?>
9<books>
10 <book>
11  <title>The Grapes of Wrath</title>
12  <author>John Steinbeck</author>
13 </book>
14 <book>
15  <title>The Pearl</title>
16  <author>John Steinbeck</author>
17 </book>
18</books>
19XML;
20
21$output = __DIR__.'/DOMNode_C14NFile_basic.tmp';
22$doc = new DOMDocument();
23$doc->loadXML($xml);
24$node = $doc->getElementsByTagName('title')->item(0);
25var_dump($node->C14NFile($output));
26$content = file_get_contents($output);
27var_dump($content);
28try {
29    var_dump($node->C14NFile($output, false, false, []));
30} catch (\ValueError $e) {
31    echo $e->getMessage() . \PHP_EOL;
32}
33try {
34    var_dump($node->C14NFile($output, false, false, ['query' => []]));
35} catch (\TypeError $e) {
36    echo $e->getMessage() . \PHP_EOL;
37}
38?>
39--CLEAN--
40<?php
41$output = __DIR__.'/DOMNode_C14NFile_basic.tmp';
42unlink($output);
43?>
44--EXPECT--
45int(34)
46string(34) "<title>The Grapes of Wrath</title>"
47DOMNode::C14NFile(): Argument #4 ($xpath) must have a "query" key
48DOMNode::C14NFile(): Argument #4 ($xpath) "query" option must be a string, array given
49