ru_php/ext/dom/tests/modern/xml/DTDNamedNodeMap.phpt

174 lines
3.2 KiB
PHP

--TEST--
DtdNamedNodeMap
--EXTENSIONS--
dom
--FILE--
<?php
$dom = Dom\XMLDocument::createFromString(<<<XML
<?xml version="1.0"?>
<!DOCTYPE root [
<!ENTITY test "entity is only for test purposes">
<!ENTITY myimage PUBLIC "-" "mypicture.gif" NDATA GIF>
<!NOTATION GIF SYSTEM "viewgif.exe">
]>
<root/>
XML);
$doctype = $dom->doctype;
var_dump($doctype);
var_dump($doctype->entities["test"]);
var_dump($doctype->entities["myimage"]);
var_dump($doctype->notations["GIF"]);
?>
--EXPECTF--
object(Dom\DocumentType)#2 (20) {
["name"]=>
string(4) "root"
["entities"]=>
string(22) "(object value omitted)"
["notations"]=>
string(22) "(object value omitted)"
["publicId"]=>
string(0) ""
["systemId"]=>
string(0) ""
["internalSubset"]=>
string(105) "<!ENTITY test "entity is only for test purposes">
<!ENTITY myimage PUBLIC "-" "mypicture.gif" NDATA GIF>
"
["nodeType"]=>
int(10)
["nodeName"]=>
string(4) "root"
["baseURI"]=>
string(%d) "%s"
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["nodeValue"]=>
NULL
["textContent"]=>
NULL
}
object(Dom\Entity)#4 (17) {
["publicId"]=>
NULL
["systemId"]=>
NULL
["notationName"]=>
NULL
["nodeType"]=>
int(17)
["nodeName"]=>
string(4) "test"
["baseURI"]=>
string(%d) "%s"
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["nodeValue"]=>
NULL
["textContent"]=>
NULL
}
object(Dom\Entity)#3 (17) {
["publicId"]=>
string(1) "-"
["systemId"]=>
string(13) "mypicture.gif"
["notationName"]=>
string(3) "GIF"
["nodeType"]=>
int(17)
["nodeName"]=>
string(7) "myimage"
["baseURI"]=>
string(%d) "%smypicture.gif"
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
NULL
["nodeValue"]=>
NULL
["textContent"]=>
NULL
}
object(Dom\Notation)#4 (14) {
["nodeType"]=>
int(12)
["nodeName"]=>
string(3) "GIF"
["baseURI"]=>
string(%d) "%s"
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
NULL
["nodeValue"]=>
NULL
["textContent"]=>
NULL
}