Annotation of embedaddon/php/ext/dom/tests/dom_comment_variation.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: DOM Comment : Variation
3: --SKIPIF--
4: <?php
5: require_once('skipif.inc');
6: ?>
7: --FILE--
8: <?php
9:
10: $xml = <<< EOXML
11: <?xml version="1.0" encoding="ISO-8859-1"?><courses><!-- Hello World! --></courses>
12: EOXML;
13:
14: $dom = new DOMDocument();
15: $dom->loadXML($xml);
16: $root = $dom->documentElement;
17: var_dump($root->hasChildNodes());
18: $children = $root->childNodes;
19:
20: for ($index = 0; $index < $children->length; $index++) {
21: echo "--- child $index ---\n";
22: $current = $children->item($index);
23: var_dump($current);
24: var_dump($current->textContent);
25: }
26:
27: --EXPECTF--
28: bool(true)
29: --- child 0 ---
30: object(DOMComment)#%d (0) {
31: }
32: string(14) " Hello World! "
33:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>