--TEST-- Dom\Document::$title getter --EXTENSIONS-- dom --FILE-- A normal title without collapsable or strippable whitespace"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString(" only ws at front"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString("only ws at back "); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString("
first
second
"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString("title"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString(" abc def ghi "); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString(""); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString(""); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString(" \t\r\n "); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString(" \tx<?y y?><![CDATA[z]]>\n "); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString("<div><!-- comment -->x</div>y<p>z</p>w"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString("title\nhere"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString("</root>"); $dom->getElementsByTagName('title')[0]->appendChild($dom->importLegacyNode(new DOMText)); var_dump($dom->title); echo "=== SVG namespaced root ===\n"; $dom = Dom\XMLDocument::createFromString("<root xmlns=\"http://www.w3.org/1999/xhtml\"><title>title"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString("title"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString("titlehi"); var_dump($dom->title); $dom = Dom\XMLDocument::createFromString(""); var_dump($dom->title); ?> --EXPECT-- === HTML namespaced root === string(59) "A normal title without collapsable or strippable whitespace" string(16) "only ws at front" string(15) "only ws at back" string(5) "first" string(5) "title" string(11) "abc def ghi" string(0) "" string(0) "" string(0) "" string(2) "xz" string(2) "yw" string(10) "title here" string(0) "" === SVG namespaced root === string(5) "title" string(5) "title" string(5) "title" string(0) ""