From: Steve Seear Date: Mon, 19 May 2008 12:56:21 +0000 (+0000) Subject: Tests from PHP London TestFest 2008 X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~188 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b20e3d9140ed39281a80f60bfd5ebcf571b5721;p=php Tests from PHP London TestFest 2008 --- diff --git a/ext/dom/tests/DOMComment_insertData_basic.phpt b/ext/dom/tests/DOMComment_insertData_basic.phpt new file mode 100644 index 0000000000..5a4857d677 --- /dev/null +++ b/ext/dom/tests/DOMComment_insertData_basic.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test inserting data into a DOMComment basic test +--CREDITS-- +Andrew Larssen +London TestFest 2008 +--SKIPIF-- + +--FILE-- +createComment('test-comment'); +$comment->insertData(4,'-inserted'); +$dom->appendChild($comment); +echo $dom->saveXML(); + +?> +--EXPECTF-- + + diff --git a/ext/dom/tests/DOMComment_insertData_error1.phpt b/ext/dom/tests/DOMComment_insertData_error1.phpt new file mode 100644 index 0000000000..56922ac518 --- /dev/null +++ b/ext/dom/tests/DOMComment_insertData_error1.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test inserting data into a DOMComment basic test +--CREDITS-- +Andrew Larssen +London TestFest 2008 +--SKIPIF-- + +--FILE-- +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 diff --git a/ext/dom/tests/DOMComment_insertData_error2.phpt b/ext/dom/tests/DOMComment_insertData_error2.phpt new file mode 100644 index 0000000000..d2affa89e7 --- /dev/null +++ b/ext/dom/tests/DOMComment_insertData_error2.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test inserting data into a DOMComment basic test +--CREDITS-- +Andrew Larssen +London TestFest 2008 +--SKIPIF-- + +--FILE-- +createComment('test-comment'); +try { + $comment->insertData(999,'-inserted'); +} catch (DOMException $e ) { + if ($e->getMessage() == 'Index Size Error'){ + echo "Throws DOMException for offset too large\n"; + } +} + +?> +--EXPECTF-- +Throws DOMException for offset too large \ No newline at end of file