Skip to content

Commit

Permalink
Add test case for bug #48339
Browse files Browse the repository at this point in the history
This now works in spec-compliant DOM.

Test by: greatwhitepine at bigfoot dot com
  • Loading branch information
nielsdos committed Mar 12, 2024
1 parent 94a12d5 commit 7ff78f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ext/dom/tests/modern/xml/bug48339.phpt
Original file line number Diff line number Diff line change
@@ -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"/>

0 comments on commit 7ff78f7

Please sign in to comment.