summaryrefslogtreecommitdiff
path: root/ext/dom/tests/DOMDocument_save_basic.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/tests/DOMDocument_save_basic.phpt')
-rw-r--r--ext/dom/tests/DOMDocument_save_basic.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/dom/tests/DOMDocument_save_basic.phpt b/ext/dom/tests/DOMDocument_save_basic.phpt
new file mode 100644
index 000000000..c7d1ead24
--- /dev/null
+++ b/ext/dom/tests/DOMDocument_save_basic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+DOMDocument::save Test basic function of save method
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+?>
+--FILE--
+<?php
+$doc = new DOMDocument('1.0');
+$doc->formatOutput = true;
+
+$root = $doc->createElement('book');
+
+$root = $doc->appendChild($root);
+
+$title = $doc->createElement('title');
+$title = $root->appendChild($title);
+
+$text = $doc->createTextNode('This is the title');
+$text = $title->appendChild($text);
+
+$temp_filename = dirname(__FILE__)."/DomDocument_save_basic.tmp";
+
+echo 'Wrote: ' . $doc->save($temp_filename) . ' bytes'; // Wrote: 72 bytes
+?>
+--CLEAN--
+<?php
+ $temp_filename = dirname(__FILE__)."/DomDocument_save_basic.tmp";
+ unlink($temp_filename);
+?>
+--EXPECTF--
+Wrote: 72 bytes
+