From: Rob Richards Date: Mon, 22 May 2006 17:05:38 +0000 (+0000) Subject: add test X-Git-Tag: BEFORE_NEW_OUTPUT_API~119 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e88f13a86d69717bdcd91f0d5473a6849bf2a676;p=php add test --- diff --git a/ext/dom/tests/regsiter_node_class.phpt b/ext/dom/tests/regsiter_node_class.phpt new file mode 100644 index 0000000000..5444cc4b9e --- /dev/null +++ b/ext/dom/tests/regsiter_node_class.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test: registerNodeClass() +--SKIPIF-- + +--FILE-- +registerNodeClass('DOMAttr', 'myAttribute'); +$doc->registerNodeClass('DOMElement', 'myElement'); +$doc->appendChild(new DOMElement('root')); +$root = $doc->documentElement; +$root->setAttribute('a', 'a1'); +var_dump($root); +print $root->testit()."\n"; +$attr = $root->getAttributeNode('a'); +var_dump($attr); +print $attr->testit()."\n"; +unset($attr); +$doc->registerNodeClass('DOMAttr', NULL); +$attr = $root->getAttributeNode('a'); +var_dump($attr); +print $attr->testit()."\n"; +?> +--EXPECTF-- + +object(myElement)#%d (0) { +} +HELLO Element +object(myAttribute)#%d (0) { +} +HELLO Attribute +object(DOMAttr)#%d (0) { +} + +Fatal error: Call to undefined method DOMAttr::testit() in %s on line 25