diff options
author | Josie Messa <jmessa@php.net> | 2008-05-21 15:04:13 +0000 |
---|---|---|
committer | Josie Messa <jmessa@php.net> | 2008-05-21 15:04:13 +0000 |
commit | b895dc0f9bfe32cc27dcc424ca23c950aa83c7e8 (patch) | |
tree | d7c61a73db4b4425c23adebe980b2a4c289163b2 /ext/dom/tests/DOMText_appendData_basic.phpt | |
parent | 2953951544dbe169bba710e236084d7103993fb8 (diff) | |
download | php-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.phpt | 35 |
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><&"</text></root>
\ No newline at end of file |