1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add test case for bug #48339

This now works in spec-compliant DOM.

Test by: greatwhitepine at bigfoot dot com
This commit is contained in:
Niels Dossche
2024-03-12 22:45:39 +01:00
parent 94a12d5b31
commit 7ff78f7b10

View File

@@ -0,0 +1,16 @@
--TEST--
Bug #48339 (DOMElement::setIdAttribute() throws 'Not Found Error' exception)
--EXTENSIONS--
dom
--FILE--
<?php
$document = DOM\XMLDocument::createEmpty();
$element = $document->createElement('test');
$element = $document->appendChild($element);
$element->setAttribute("xml:id", 1);
$element->setIdAttribute("xml:id", TRUE);
echo $document->saveXML(), "\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<test xml:id="1"/>