--TEST--
Dom\Element::insertAdjacentHTML() with XML nodes
--EXTENSIONS--
dom
--FILE--
name, " ---\n";
$dom = Dom\XMLDocument::createFromString('');
$div = $dom->documentElement->firstChild;
$div->append("Sample text");
$div->insertAdjacentHTML($position, $xml);
echo $dom->saveXML(), "\n";
var_dump($div->childNodes->length);
var_dump($dom->documentElement->childNodes->length);
}
}
test('');
test('&');
test('text node');
?>
--EXPECT--
=== XML () ===
--- Position BeforeBegin ---
Sample text
int(1)
int(3)
--- Position AfterBegin ---
Sample text
int(3)
int(1)
--- Position BeforeEnd ---
Sample text
int(3)
int(1)
--- Position AfterEnd ---
Sample text
int(1)
int(3)
=== XML (&) ===
--- Position BeforeBegin ---
&Sample text
int(1)
int(4)
--- Position AfterBegin ---
&Sample text
int(4)
int(1)
--- Position BeforeEnd ---
Sample text&
int(4)
int(1)
--- Position AfterEnd ---
Sample text
&
int(1)
int(4)
=== XML (text node) ===
--- Position BeforeBegin ---
text nodeSample text
int(1)
int(2)
--- Position AfterBegin ---
text nodeSample text
int(2)
int(1)
--- Position BeforeEnd ---
Sample texttext node
int(2)
int(1)
--- Position AfterEnd ---
Sample text
text node
int(1)
int(2)