xref: /PHP-8.1/ext/dom/tests/bug81433.phpt (revision 424c2654)
1--TEST--
2Bug #81433 (DOMElement::setIdAttribute(attr, true) called twice removes ID)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$dom = new DOMDocument('1.0', 'utf-8');
8
9$element = $dom->createElement('test', 'root');
10
11$dom->appendChild($element);
12
13$element->setAttribute("id", 123);
14$element->setIdAttribute("id", true);
15
16$node = $element->getAttributeNode("id");
17var_dump($node->isId());
18
19$element->setIdAttribute("id", true);
20var_dump($node->isId());
21?>
22--EXPECT--
23bool(true)
24bool(true)
25