summaryrefslogtreecommitdiff
path: root/ext/dom/tests/DOMText_appendData_basic.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/tests/DOMText_appendData_basic.phpt')
-rw-r--r--ext/dom/tests/DOMText_appendData_basic.phpt35
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/dom/tests/DOMText_appendData_basic.phpt b/ext/dom/tests/DOMText_appendData_basic.phpt
new file mode 100644
index 000000000..6a28a9ae4
--- /dev/null
+++ b/ext/dom/tests/DOMText_appendData_basic.phpt
@@ -0,0 +1,35 @@
+--TEST--
+DOMText::appendData basic functionality test
+--CREDITS--
+Mike Sullivan <mike@regexia.com>
+#TestFest 2008 (London)
+--FILE--
+<?php
+
+$document = new DOMDocument;
+$root = $document->createElement('root');
+$document->appendChild($root);
+
+$text = $document->createElement('text');
+$root->appendChild($text);
+
+$textnode = $document->createTextNode('');
+$text->appendChild($textnode);
+$textnode->appendData('data');
+echo "Text Length (one append): " . $textnode->length . "\n";
+
+$textnode->appendData('><&"');
+echo "Text Length (two appends): " . $textnode->length . "\n";
+
+echo "Text Content: " . $textnode->data . "\n";
+
+echo "\n" . $document->saveXML();
+
+?>
+--EXPECT--
+Text Length (one append): 4
+Text Length (two appends): 8
+Text Content: data><&"
+
+<?xml version="1.0"?>
+<root><text>data&gt;&lt;&amp;"</text></root> \ No newline at end of file