php-src/ext/dom/tests/DOMComment_insertData_error1.phpt

25 lines
507 B
Plaintext
Raw Normal View History

2008-05-19 20:56:21 +08:00
--TEST--
Test inserting 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->insertData(-1,'-inserted');
} catch (DOMException $e ) {
if ($e->getMessage() == 'Index Size Error'){
echo "Throws DOMException for -ve offset\n";
}
}
?>
--EXPECTF--
Throws DOMException for -ve offset