summaryrefslogtreecommitdiff
path: root/ext/dom/tests/DOMNode_C14NFile_basic.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/tests/DOMNode_C14NFile_basic.phpt')
-rw-r--r--ext/dom/tests/DOMNode_C14NFile_basic.phpt38
1 files changed, 38 insertions, 0 deletions
diff --git a/ext/dom/tests/DOMNode_C14NFile_basic.phpt b/ext/dom/tests/DOMNode_C14NFile_basic.phpt
new file mode 100644
index 0000000..6af6e3e
--- /dev/null
+++ b/ext/dom/tests/DOMNode_C14NFile_basic.phpt
@@ -0,0 +1,38 @@
+--TEST--
+DOMNode::C14NFile()
+--SKIPIF--
+<?php
+include('skipif.inc');
+?>
+--FILE--
+<?php
+$xml = <<< XML
+<?xml version="1.0" ?>
+<books>
+ <book>
+ <title>The Grapes of Wrath</title>
+ <author>John Steinbeck</author>
+ </book>
+ <book>
+ <title>The Pearl</title>
+ <author>John Steinbeck</author>
+ </book>
+</books>
+XML;
+
+$output = dirname(__FILE__).'/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);
+?>
+--CLEAN--
+<?php
+$output = dirname(__FILE__).'/DOMNode_C14NFile_basic.tmp';
+unlink($output);
+?>
+--EXPECTF--
+int(34)
+string(34) "<title>The Grapes of Wrath</title>"