Annotation of embedaddon/php/ext/dom/tests/bug42082.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #42082 (NodeList length zero should be empty)
! 3: --SKIPIF--
! 4: <?php require_once('skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7: $doc = new DOMDocument();
! 8: $xpath = new DOMXPath($doc);
! 9: $nodes = $xpath->query('*');
! 10: var_dump($nodes);
! 11: var_dump($nodes->length);
! 12: $length = $nodes->length;
! 13: var_dump(empty($nodes->length), empty($length));
! 14:
! 15: $doc->loadXML("<element></element>");
! 16: var_dump($doc->firstChild->nodeValue, empty($doc->firstChild->nodeValue), isset($doc->firstChild->nodeValue));
! 17: var_dump(empty($doc->nodeType), empty($doc->firstChild->nodeType))
! 18: ?>
! 19: ===DONE===
! 20: --EXPECTF--
! 21: object(DOMNodeList)#%d (0) {
! 22: }
! 23: int(0)
! 24: bool(true)
! 25: bool(true)
! 26: string(0) ""
! 27: bool(true)
! 28: bool(true)
! 29: bool(false)
! 30: bool(false)
! 31: ===DONE===
! 32:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>