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