--- /dev/null
+--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-->
--- /dev/null
+--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
+
+//Negative offset
+$dom = new DomDocument();
+$comment = $dom->createComment('test-comment');
+try {
+ $comment->replaceData(-1,4,'-inserted');
+} catch (DOMException $e ) {
+ if ($e->getMessage() == 'Index Size Error'){
+ echo "Throws DOMException for -ve offest\n";
+ }
+}
+
+?>
+--EXPECTF--
+Throws DOMException for -ve offest
--- /dev/null
+--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
+
+//offset to large
+$dom = new DomDocument();
+$comment = $dom->createComment('test-comment');
+try {
+ $comment->replaceData(999,4,'-inserted');
+} catch (DOMException $e ) {
+ if ($e->getMessage() == 'Index Size Error'){
+ echo "Throws DOMException for offest too large\n";
+ }
+}
+
+?>
+--EXPECTF--
+Throws DOMException for offest too large
\ No newline at end of file