summaryrefslogtreecommitdiff
path: root/ext/dom/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/tests')
-rw-r--r--ext/dom/tests/bug78221.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/dom/tests/bug78221.phpt b/ext/dom/tests/bug78221.phpt
new file mode 100644
index 0000000000..a9bf50d98e
--- /dev/null
+++ b/ext/dom/tests/bug78221.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #78221 (DOMNode::normalize() doesn't remove empty text nodes)
+--SKIPIF--
+<?php
+if (!extension_loaded('dom')) die('skip dom extension not available');
+?>
+--FILE--
+<?php
+$doc = new DOMDocument();
+$doc->loadHTML('<p id=x>foo</p>');
+$p = $doc->getElementById('x');
+$p->childNodes[0]->textContent = '';
+$p->normalize();
+var_dump($p->childNodes->length);
+?>
+--EXPECT--
+int(0)