diff options
Diffstat (limited to 'ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt')
-rw-r--r-- | ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt b/ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt new file mode 100644 index 0000000..15c81b2 --- /dev/null +++ b/ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt @@ -0,0 +1,21 @@ +--TEST-- +SimpleXMLElement->addAttribute() +--SKIPIF-- +<?php if (!extension_loaded("simplexml")) die("skip"); ?> +--FILE-- +<?php + $simple = simplexml_load_file(dirname(__FILE__)."/book.xml"); + $simple->addAttribute('type','novels'); + + var_dump($simple->attributes()); + echo "Done"; +?> +--EXPECTF-- +object(SimpleXMLElement)#2 (1) { + ["@attributes"]=> + array(1) { + ["type"]=> + string(6) "novels" + } +} +Done
\ No newline at end of file |