summaryrefslogtreecommitdiff
path: root/ext/dom/tests/DOMText_appendData_basic.phpt
diff options
context:
space:
mode:
authorJosie Messa <jmessa@php.net>2008-05-21 15:04:13 +0000
committerJosie Messa <jmessa@php.net>2008-05-21 15:04:13 +0000
commitb895dc0f9bfe32cc27dcc424ca23c950aa83c7e8 (patch)
treed7c61a73db4b4425c23adebe980b2a4c289163b2 /ext/dom/tests/DOMText_appendData_basic.phpt
parent2953951544dbe169bba710e236084d7103993fb8 (diff)
downloadphp-git-b895dc0f9bfe32cc27dcc424ca23c950aa83c7e8.tar.gz
- Committing tests reviewed after London TestFest 08
- Credits to: Mike Sullivan and James Lewis
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 0000000000..6a28a9ae45
--- /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