php-src/ext/dom/tests/DOMComment_insertData_error1.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

25 lines
506 B
PHP

--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";
}
}
?>
--EXPECT--
Throws DOMException for -ve offset