1--TEST--
2DOMParentNode: Child Element Handling
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7require_once("dom_test.inc");
8
9$dom = new DOMDocument;
10$dom->loadXML('<test></test>');
11
12$fragment = $dom->createDocumentFragment();
13$fragment->appendChild($dom->createTextNode('foo'));
14$fragment->appendChild($dom->createElement('bar', 'FirstElement'));
15$fragment->appendChild($dom->createElement('bar', 'LastElement'));
16$fragment->appendChild($dom->createTextNode('bar'));
17
18var_dump($fragment instanceof DOMParentNode);
19print_node($fragment->firstElementChild);
20print_node($fragment->lastElementChild);
21var_dump($fragment->childElementCount);
22var_dump($fragment->lastElementChild->firstElementChild);
23var_dump($fragment->lastElementChild->lastElementChild);
24var_dump($fragment->lastElementChild->childElementCount);
25?>
26--EXPECT--
27bool(true)
28Node Name: bar
29Node Type: 1
30Num Children: 1
31Node Content: FirstElement
32
33Node Name: bar
34Node Type: 1
35Num Children: 1
36Node Content: LastElement
37
38int(2)
39NULL
40NULL
41int(0)
42