Annotation of embedaddon/php/ext/dom/tests/DOMComment_replaceData_basic.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test replacing data into a DOMComment basic test
                      3: --CREDITS--
                      4: Andrew Larssen <al@larssen.org>
                      5: London TestFest 2008
                      6: --SKIPIF--
                      7: <?php require_once('skipif.inc'); ?>
                      8: --FILE--
                      9: <?php
                     10: 
                     11: $dom = new DomDocument();
                     12: $comment = $dom->createComment('test-comment');
                     13: $comment->replaceData(4,1,'replaced');
                     14: $dom->appendChild($comment);
                     15: echo $dom->saveXML();
                     16: 
                     17: // Replaces rest of string if count is greater than length of existing string
                     18: $dom = new DomDocument();
                     19: $comment = $dom->createComment('test-comment');
                     20: $comment->replaceData(0,50,'replaced');
                     21: $dom->appendChild($comment);
                     22: echo $dom->saveXML();
                     23: 
                     24: ?>
                     25: --EXPECTF--
                     26: <?xml version="1.0"?>
                     27: <!--testreplacedcomment-->
                     28: <?xml version="1.0"?>
                     29: <!--replaced-->

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>