mirror of
https://github.com/php/php-src.git
synced 2024-12-05 07:46:06 +08:00
25 lines
510 B
Plaintext
25 lines
510 B
Plaintext
|
--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
|