Annotation of embedaddon/php/ext/simplexml/tests/bug43221.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #43221 (SimpleXML adding default namespace in addAttribute)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7: $xml = simplexml_load_string('<?xml version="1.0" encoding="utf-8"?><root />');
! 8: $n = $xml->addChild("node", "value");
! 9: $n->addAttribute("a", "b");
! 10: $n->addAttribute("c", "d", "http://bar.com");
! 11: $n->addAttribute("foo:e", "f", "http://bar.com");
! 12: print_r($xml->asXml());
! 13: ?>
! 14: ===DONE===
! 15: --EXPECTF--
! 16: Warning: SimpleXMLElement::addAttribute(): Attribute requires prefix for namespace in %sbug43221.php on line %d
! 17: <?xml version="1.0" encoding="utf-8"?>
! 18: <root><node xmlns:foo="http://bar.com" a="b" foo:e="f">value</node></root>
! 19: ===DONE===
! 20:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>