Annotation of embedaddon/php/ext/dom/tests/dom_comment_variation.phpt, revision 1.1.1.2
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);
1.1.1.2 ! misho 23: echo get_class($current), "\n";
1.1 misho 24: var_dump($current->textContent);
25: }
26:
27: --EXPECTF--
28: bool(true)
29: --- child 0 ---
1.1.1.2 ! misho 30: DOMComment
1.1 misho 31: string(14) " Hello World! "
32:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>