1--TEST--
2DtdNamedNodeMap
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = Dom\XMLDocument::createFromString(<<<XML
9<?xml version="1.0"?>
10<!DOCTYPE root [
11<!ENTITY test "entity is only for test purposes">
12<!ENTITY myimage PUBLIC "-" "mypicture.gif" NDATA GIF>
13<!NOTATION GIF SYSTEM "viewgif.exe">
14]>
15<root/>
16XML);
17
18$doctype = $dom->doctype;
19
20var_dump($doctype);
21
22var_dump($doctype->entities["test"]);
23var_dump($doctype->entities["myimage"]);
24// TODO: isConnected returning false is a bug
25var_dump($doctype->notations["GIF"]);
26
27?>
28--EXPECTF--
29object(Dom\DocumentType)#2 (24) {
30  ["name"]=>
31  string(4) "root"
32  ["entities"]=>
33  string(22) "(object value omitted)"
34  ["notations"]=>
35  string(22) "(object value omitted)"
36  ["publicId"]=>
37  string(0) ""
38  ["systemId"]=>
39  string(0) ""
40  ["internalSubset"]=>
41  string(105) "<!ENTITY test "entity is only for test purposes">
42<!ENTITY myimage PUBLIC "-" "mypicture.gif" NDATA GIF>
43"
44  ["nodeName"]=>
45  string(4) "root"
46  ["nodeValue"]=>
47  NULL
48  ["nodeType"]=>
49  int(10)
50  ["parentNode"]=>
51  string(22) "(object value omitted)"
52  ["parentElement"]=>
53  NULL
54  ["childNodes"]=>
55  string(22) "(object value omitted)"
56  ["firstChild"]=>
57  NULL
58  ["lastChild"]=>
59  NULL
60  ["previousSibling"]=>
61  NULL
62  ["nextSibling"]=>
63  string(22) "(object value omitted)"
64  ["attributes"]=>
65  NULL
66  ["isConnected"]=>
67  bool(true)
68  ["ownerDocument"]=>
69  string(22) "(object value omitted)"
70  ["namespaceURI"]=>
71  NULL
72  ["prefix"]=>
73  string(0) ""
74  ["localName"]=>
75  NULL
76  ["baseURI"]=>
77  string(%d) "%s"
78  ["textContent"]=>
79  NULL
80}
81object(Dom\Entity)#4 (17) {
82  ["publicId"]=>
83  NULL
84  ["systemId"]=>
85  NULL
86  ["notationName"]=>
87  NULL
88  ["nodeType"]=>
89  int(17)
90  ["nodeName"]=>
91  string(4) "test"
92  ["baseURI"]=>
93  string(%d) "%s"
94  ["isConnected"]=>
95  bool(true)
96  ["ownerDocument"]=>
97  string(22) "(object value omitted)"
98  ["parentNode"]=>
99  string(22) "(object value omitted)"
100  ["parentElement"]=>
101  NULL
102  ["childNodes"]=>
103  string(22) "(object value omitted)"
104  ["firstChild"]=>
105  NULL
106  ["lastChild"]=>
107  NULL
108  ["previousSibling"]=>
109  NULL
110  ["nextSibling"]=>
111  string(22) "(object value omitted)"
112  ["nodeValue"]=>
113  NULL
114  ["textContent"]=>
115  NULL
116}
117object(Dom\Entity)#3 (17) {
118  ["publicId"]=>
119  string(1) "-"
120  ["systemId"]=>
121  string(13) "mypicture.gif"
122  ["notationName"]=>
123  string(3) "GIF"
124  ["nodeType"]=>
125  int(17)
126  ["nodeName"]=>
127  string(7) "myimage"
128  ["baseURI"]=>
129  string(%d) "%smypicture.gif"
130  ["isConnected"]=>
131  bool(true)
132  ["ownerDocument"]=>
133  string(22) "(object value omitted)"
134  ["parentNode"]=>
135  string(22) "(object value omitted)"
136  ["parentElement"]=>
137  NULL
138  ["childNodes"]=>
139  string(22) "(object value omitted)"
140  ["firstChild"]=>
141  NULL
142  ["lastChild"]=>
143  NULL
144  ["previousSibling"]=>
145  string(22) "(object value omitted)"
146  ["nextSibling"]=>
147  NULL
148  ["nodeValue"]=>
149  NULL
150  ["textContent"]=>
151  NULL
152}
153object(Dom\Notation)#4 (13) {
154  ["nodeType"]=>
155  int(12)
156  ["nodeName"]=>
157  string(3) "GIF"
158  ["baseURI"]=>
159  NULL
160  ["isConnected"]=>
161  bool(false)
162  ["parentNode"]=>
163  NULL
164  ["parentElement"]=>
165  NULL
166  ["childNodes"]=>
167  string(22) "(object value omitted)"
168  ["firstChild"]=>
169  NULL
170  ["lastChild"]=>
171  NULL
172  ["previousSibling"]=>
173  NULL
174  ["nextSibling"]=>
175  NULL
176  ["nodeValue"]=>
177  NULL
178  ["textContent"]=>
179  string(0) ""
180}
181