summaryrefslogtreecommitdiff
path: root/ext/dom/tests/DOMComment_replaceData_basic.phpt
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2008-05-17 13:26:51 +0000
committerZoe Slattery <zoe@php.net>2008-05-17 13:26:51 +0000
commit8ced03e02664314aeea1952bff6fb5e06576c629 (patch)
treea54cc2a9604fbfc3f436cf4757bbe4e0b2c77792 /ext/dom/tests/DOMComment_replaceData_basic.phpt
parent53abdc3f57d52d0db89c2fa9475a797d38e05487 (diff)
downloadphp-git-8ced03e02664314aeea1952bff6fb5e06576c629.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.phpt29
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-->