Annotation of embedaddon/php/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: DOMComment::appendData basic functionality test
! 3: --CREDITS--
! 4: Mike Sullivan <mike@regexia.com>
! 5: #TestFest 2008 (London)
! 6: --SKIPIF--
! 7: <?php require_once('skipif.inc'); ?>
! 8: --FILE--
! 9: <?php
! 10:
! 11: $document = new DOMDocument;
! 12: $root = $document->createElement('root');
! 13: $document->appendChild($root);
! 14:
! 15: $comment = $document->createElement('comment');
! 16: $root->appendChild($comment);
! 17:
! 18: $commentnode = $document->createComment('');
! 19: $comment->appendChild($commentnode);
! 20: $commentnode->appendData('data');
! 21: echo "Comment Length (one append): " . $commentnode->length . "\n";
! 22:
! 23: $commentnode->appendData('><&"');
! 24: echo "Comment Length (two appends): " . $commentnode->length . "\n";
! 25:
! 26: echo "Comment Content: " . $commentnode->data . "\n";
! 27:
! 28: echo "\n" . $document->saveXML();
! 29:
! 30: ?>
! 31: --EXPECT--
! 32: Comment Length (one append): 4
! 33: Comment Length (two appends): 8
! 34: Comment Content: data><&"
! 35:
! 36: <?xml version="1.0"?>
! 37: <root><comment><!--data><&"--></comment></root>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>