Annotation of embedaddon/php/ext/simplexml/tests/profile13.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: SimpleXML [profile]: Accessing by namespace prefix
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: $xml =<<<EOF
                      9: <?xml version="1.0" encoding="utf-8"?>
                     10: <soap:Envelope
                     11: xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
                     12: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                     13: xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     14: >
                     15: <soap:Body>
                     16: <businessList foo="bar">
                     17: <businessInfo businessKey="bla"/>
                     18: </businessList>
                     19: </soap:Body> 
                     20: </soap:Envelope>
                     21: EOF;
                     22: 
                     23: $sxe = simplexml_load_string($xml);
                     24: var_dump($sxe->children('soap', 1));
                     25: 
                     26: $sxe = simplexml_load_string($xml, NULL, 0, 'soap', 1);
                     27: var_dump($sxe->Body);
                     28: var_dump($sxe->Body->children(''));
                     29: var_dump($sxe->Body->children('')->businessList);
                     30: 
                     31: ?>
                     32: ===DONE===
                     33: <?php exit(0); ?>
                     34: --EXPECTF--
                     35: object(SimpleXMLElement)#%d (1) {
                     36:   ["Body"]=>
                     37:   object(SimpleXMLElement)#%d (0) {
                     38:   }
                     39: }
                     40: object(SimpleXMLElement)#%d (0) {
                     41: }
                     42: object(SimpleXMLElement)#%d (1) {
                     43:   ["businessList"]=>
                     44:   object(SimpleXMLElement)#%d (2) {
                     45:     ["@attributes"]=>
                     46:     array(1) {
                     47:       ["foo"]=>
                     48:       string(3) "bar"
                     49:     }
                     50:     ["businessInfo"]=>
                     51:     object(SimpleXMLElement)#%d (1) {
                     52:       ["@attributes"]=>
                     53:       array(1) {
                     54:         ["businessKey"]=>
                     55:         string(3) "bla"
                     56:       }
                     57:     }
                     58:   }
                     59: }
                     60: object(SimpleXMLElement)#%d (2) {
                     61:   ["@attributes"]=>
                     62:   array(1) {
                     63:     ["foo"]=>
                     64:     string(3) "bar"
                     65:   }
                     66:   ["businessInfo"]=>
                     67:   object(SimpleXMLElement)#%d (1) {
                     68:     ["@attributes"]=>
                     69:     array(1) {
                     70:       ["businessKey"]=>
                     71:       string(3) "bla"
                     72:     }
                     73:   }
                     74: }
                     75: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>