[php-src] master: Add test case for bug #48339
| From: | Niels Dossche | Date: | Tue, 12 Mar 2024 22:00:09 +0000 |
| Subject: | [php-src] master: Add test case for bug #48339 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-127711@lists.php.net to get a copy of this message | ||
Author: Niels Dossche (nielsdos)
Date: 2024-03-12T22:45:39+01:00
Commit: https://github.com/php/php-src/commit/7ff78f7b101c02717356c0b57722a8abad0cd7fd
Raw diff: https://github.com/php/php-src/commit/7ff78f7b101c02717356c0b57722a8abad0cd7fd.diff
Add test case for bug #48339
This now works in spec-compliant DOM.
Test by: greatwhitepine at bigfoot dot com
Changed paths:
A ext/dom/tests/modern/xml/bug48339.phpt
Diff:
diff --git a/ext/dom/tests/modern/xml/bug48339.phpt b/ext/dom/tests/modern/xml/bug48339.phpt
new file mode 100644
index 0000000000000..1e57927ae7f2b
--- /dev/null
+++ b/ext/dom/tests/modern/xml/bug48339.phpt
@@ -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"/>