diff options
author | Zoe Slattery <zoe@php.net> | 2008-05-17 11:20:55 +0000 |
---|---|---|
committer | Zoe Slattery <zoe@php.net> | 2008-05-17 11:20:55 +0000 |
commit | f0955264a09bd055ae578b084337715deaf48343 (patch) | |
tree | fa5aa2ad154eb3dc98f8a8fbba8cf8183b99d3d7 /ext/dom/tests/DOMComment_replaceData_basic.phpt | |
parent | d7570b4671524f5ec6a26215cd38e201ee5853b1 (diff) | |
download | php-git-f0955264a09bd055ae578b084337715deaf48343.tar.gz |
Tests from London test fest 2008
Diffstat (limited to 'ext/dom/tests/DOMComment_replaceData_basic.phpt')
-rw-r--r-- | ext/dom/tests/DOMComment_replaceData_basic.phpt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/dom/tests/DOMComment_replaceData_basic.phpt b/ext/dom/tests/DOMComment_replaceData_basic.phpt new file mode 100644 index 0000000000..10bf677ff3 --- /dev/null +++ b/ext/dom/tests/DOMComment_replaceData_basic.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test replacing data into a DOMComment basic test +--CREDITS-- +Andrew Larssen <al@larssen.org> +London TestFest 2008 +--SKIPIF-- +<?php // require_once('skipif.inc'); ?> +--FILE-- +<?php + +$dom = new DomDocument(); +$comment = $dom->createComment('test-comment'); +$comment->replaceData(4,1,'replaced'); +$dom->appendChild($comment); +echo $dom->saveXML(); + +// Replaces rest of string if count is greater than length of existing string +$dom = new DomDocument(); +$comment = $dom->createComment('test-comment'); +$comment->replaceData(0,50,'replaced'); +$dom->appendChild($comment); +echo $dom->saveXML(); + +?> +--EXPECTF-- +<?xml version="1.0"?> +<!--testreplacedcomment--> +<?xml version="1.0"?> +<!--replaced--> |