Skip to content

Commit e5e8857

Browse files
Add a regression test for phpGH-10234
Co-authored-by: ThomasWeinert <[email protected]>
1 parent 6aa33f2 commit e5e8857

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

ext/dom/tests/gh10234.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
GH-10234 (Setting DOMAttr::textContent results in an empty attribute value.)
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
$document = new DOMDocument();
8+
$document->loadXML('<element attribute="value"/>');
9+
$attribute = $document->documentElement->getAttributeNode('attribute');
10+
11+
// output loaded attribute value
12+
var_dump($attribute->textContent);
13+
14+
// change value
15+
$attribute->textContent = 'new value';
16+
17+
// output changed value
18+
var_dump($attribute->textContent);
19+
?>
20+
--EXPECT--
21+
string(5) "value"
22+
string(9) "new value"

0 commit comments

Comments
 (0)