1--TEST--
2Document::$implementation createDocumentType
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$test_matrix = [
9    ['uri' => 'qname', 'public' => 'public', 'system' => 'system'],
10    ['uri' => 'qname', 'public' => 'public', 'system' => ''],
11    ['uri' => 'qname', 'public' => '', 'system' => 'system'],
12    ['uri' => 'qname', 'public' => '', 'system' => ''],
13];
14
15foreach ($test_matrix as $test_item) {
16    $dom = DOM\XMLDocument::createEmpty();
17    $dtd = $dom->implementation->createDocumentType($test_item['uri'], $test_item['public'], $test_item['system']);
18
19    var_dump($dtd);
20
21    $dom->append($dom->importNode($dtd));
22
23    echo $dom->saveXML(), "\n";
24}
25
26?>
27--EXPECT--
28object(DOM\DocumentType)#3 (23) {
29  ["name"]=>
30  string(5) "qname"
31  ["entities"]=>
32  string(22) "(object value omitted)"
33  ["notations"]=>
34  string(22) "(object value omitted)"
35  ["publicId"]=>
36  string(6) "public"
37  ["systemId"]=>
38  string(6) "system"
39  ["internalSubset"]=>
40  NULL
41  ["nodeName"]=>
42  string(5) "qname"
43  ["nodeValue"]=>
44  NULL
45  ["nodeType"]=>
46  int(10)
47  ["parentNode"]=>
48  NULL
49  ["parentElement"]=>
50  NULL
51  ["childNodes"]=>
52  string(22) "(object value omitted)"
53  ["firstChild"]=>
54  NULL
55  ["lastChild"]=>
56  NULL
57  ["previousSibling"]=>
58  NULL
59  ["nextSibling"]=>
60  NULL
61  ["attributes"]=>
62  NULL
63  ["isConnected"]=>
64  bool(false)
65  ["namespaceURI"]=>
66  NULL
67  ["prefix"]=>
68  string(0) ""
69  ["localName"]=>
70  NULL
71  ["baseURI"]=>
72  NULL
73  ["textContent"]=>
74  string(0) ""
75}
76<?xml version="1.0" encoding="UTF-8"?>
77<!DOCTYPE qname PUBLIC "public" "system">
78
79object(DOM\DocumentType)#2 (23) {
80  ["name"]=>
81  string(5) "qname"
82  ["entities"]=>
83  string(22) "(object value omitted)"
84  ["notations"]=>
85  string(22) "(object value omitted)"
86  ["publicId"]=>
87  string(6) "public"
88  ["systemId"]=>
89  string(0) ""
90  ["internalSubset"]=>
91  NULL
92  ["nodeName"]=>
93  string(5) "qname"
94  ["nodeValue"]=>
95  NULL
96  ["nodeType"]=>
97  int(10)
98  ["parentNode"]=>
99  NULL
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  NULL
112  ["attributes"]=>
113  NULL
114  ["isConnected"]=>
115  bool(false)
116  ["namespaceURI"]=>
117  NULL
118  ["prefix"]=>
119  string(0) ""
120  ["localName"]=>
121  NULL
122  ["baseURI"]=>
123  NULL
124  ["textContent"]=>
125  string(0) ""
126}
127<?xml version="1.0" encoding="UTF-8"?>
128<!DOCTYPE qname PUBLIC "public" "">
129
130object(DOM\DocumentType)#1 (23) {
131  ["name"]=>
132  string(5) "qname"
133  ["entities"]=>
134  string(22) "(object value omitted)"
135  ["notations"]=>
136  string(22) "(object value omitted)"
137  ["publicId"]=>
138  string(0) ""
139  ["systemId"]=>
140  string(6) "system"
141  ["internalSubset"]=>
142  NULL
143  ["nodeName"]=>
144  string(5) "qname"
145  ["nodeValue"]=>
146  NULL
147  ["nodeType"]=>
148  int(10)
149  ["parentNode"]=>
150  NULL
151  ["parentElement"]=>
152  NULL
153  ["childNodes"]=>
154  string(22) "(object value omitted)"
155  ["firstChild"]=>
156  NULL
157  ["lastChild"]=>
158  NULL
159  ["previousSibling"]=>
160  NULL
161  ["nextSibling"]=>
162  NULL
163  ["attributes"]=>
164  NULL
165  ["isConnected"]=>
166  bool(false)
167  ["namespaceURI"]=>
168  NULL
169  ["prefix"]=>
170  string(0) ""
171  ["localName"]=>
172  NULL
173  ["baseURI"]=>
174  NULL
175  ["textContent"]=>
176  string(0) ""
177}
178<?xml version="1.0" encoding="UTF-8"?>
179<!DOCTYPE qname SYSTEM "system">
180
181object(DOM\DocumentType)#4 (23) {
182  ["name"]=>
183  string(5) "qname"
184  ["entities"]=>
185  string(22) "(object value omitted)"
186  ["notations"]=>
187  string(22) "(object value omitted)"
188  ["publicId"]=>
189  string(0) ""
190  ["systemId"]=>
191  string(0) ""
192  ["internalSubset"]=>
193  NULL
194  ["nodeName"]=>
195  string(5) "qname"
196  ["nodeValue"]=>
197  NULL
198  ["nodeType"]=>
199  int(10)
200  ["parentNode"]=>
201  NULL
202  ["parentElement"]=>
203  NULL
204  ["childNodes"]=>
205  string(22) "(object value omitted)"
206  ["firstChild"]=>
207  NULL
208  ["lastChild"]=>
209  NULL
210  ["previousSibling"]=>
211  NULL
212  ["nextSibling"]=>
213  NULL
214  ["attributes"]=>
215  NULL
216  ["isConnected"]=>
217  bool(false)
218  ["namespaceURI"]=>
219  NULL
220  ["prefix"]=>
221  string(0) ""
222  ["localName"]=>
223  NULL
224  ["baseURI"]=>
225  NULL
226  ["textContent"]=>
227  string(0) ""
228}
229<?xml version="1.0" encoding="UTF-8"?>
230<!DOCTYPE qname>
231