From: Steve Seear Date: Mon, 19 May 2008 12:22:23 +0000 (+0000) Subject: Tests from PHP London TestFest 2008 X-Git-Tag: BEFORE_HEAD_NS_CHANGE~1731 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=363df894a99e99ab06bffe0ab7685e2f9bf9679d;p=php Tests from PHP London TestFest 2008 --- diff --git a/ext/dom/DOMComment_appendData_basic.phpt b/ext/dom/DOMComment_appendData_basic.phpt new file mode 100644 index 0000000000..c756f1665a --- /dev/null +++ b/ext/dom/DOMComment_appendData_basic.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test adding data to a DOMComment +--CREDITS-- +Andrew Larssen +London TestFest 2008 +--SKIPIF-- + +--FILE-- +createComment('test-comment'); +$comment->appendData('-more-data'); +$dom->appendChild($comment); +$dom->saveXML(); +echo $dom->saveXML(); + +?> +--EXPECTF-- + + \ No newline at end of file diff --git a/ext/dom/DOMElement_hasAttributes_basic.phpt b/ext/dom/DOMElement_hasAttributes_basic.phpt new file mode 100644 index 0000000000..f0d0c355b8 --- /dev/null +++ b/ext/dom/DOMElement_hasAttributes_basic.phpt @@ -0,0 +1,49 @@ +--TEST-- +DOMNode: hasAttributes() +--CREDITS-- +James Lewis +#TestFest 2008 +--FILE-- +loadXML($xmlstr); +if(!$dom) { + echo "Error while parsing the document\n"; + exit; +} + +$element = $dom->documentElement; + +echo "Verify that we have a DOMElement object:\n"; +var_dump($element); + +echo "\nElement should have attributes:\n"; +var_dump($element->hasAttributes()); + +$nodelist=$dom->getElementsByTagName('tbody') ; +$element = $nodelist->item(0); + +echo "\nVerify that we have a DOMElement object:\n"; +var_dump($element); + +echo "\nElement should have no attributes:\n"; +var_dump($element->hasAttributes()) + + +?> +--EXPECTF-- +Verify that we have a DOMElement object: +object(DOMElement)#%d (0) { +} + +Element should have attributes: +bool(true) + +Verify that we have a DOMElement object: +object(DOMElement)#%d (0) { +} + +Element should have no attributes: +bool(false)