1--TEST--
2Test reading Element::$innerHTML on HTML documents
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = DOM\HTMLDocument::createFromString('<!DOCTYPE html><html><head><title>Test</title></head><body><div></div><p>Hello, World!</p></body></html>');
9var_dump($dom->getElementsByTagName('body')[0]->innerHTML);
10var_dump($dom->getElementsByTagName('head')[0]->innerHTML);
11var_dump($dom->getElementsByTagName('html')[0]->innerHTML);
12var_dump($dom->getElementsByTagName('div')[0]->innerHTML);
13var_dump($dom->getElementsByTagName('p')[0]->innerHTML);
14
15?>
16--EXPECT--
17string(31) "<div></div><p>Hello, World!</p>"
18string(19) "<title>Test</title>"
19string(76) "<head><title>Test</title></head><body><div></div><p>Hello, World!</p></body>"
20string(0) ""
21string(13) "Hello, World!"
22