xref: /PHP-7.3/ext/dom/tests/bug78221.phpt (revision efec22b7)
1--TEST--
2Bug #78221 (DOMNode::normalize() doesn't remove empty text nodes)
3--SKIPIF--
4<?php
5if (!extension_loaded('dom')) die('skip dom extension not available');
6?>
7--FILE--
8<?php
9$doc = new DOMDocument();
10$doc->loadHTML('<p id=x>foo</p>');
11$p = $doc->getElementById('x');
12$p->childNodes[0]->textContent = '';
13$p->normalize();
14var_dump($p->childNodes->length);
15?>
16--EXPECT--
17int(0)
18