Annotation of embedaddon/php/ext/dom/tests/bug38474.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #38474 (getAttribute select attribute by order, even when prefixed) (OK to fail with libxml2 < 2.6.2x)
        !             3: --SKIPIF--
        !             4: <?php 
        !             5: require_once('skipif.inc');
        !             6: if (version_compare(LIBXML_DOTTED_VERSION, "2.6.20", "<")) {
        !             7:     print "skip libxml version " . LIBXML_DOTTED_VERSION;
        !             8: }   
        !             9: ?>
        !            10: --FILE--
        !            11: <?php
        !            12: $xml = '<node xmlns:pre="http://foo.com/tr/pre        !            13:               xmlns:post="http://foo.com/tr/post"
        !            14:               pre:type="bar" type="foo" ><sub /></node>';
        !            15: $dom = new DomDocument();
        !            16: $dom->loadXML($xml);
        !            17: echo $dom->firstChild->getAttribute('type')."\n";
        !            18: echo $dom->firstChild->getAttribute('pre:type')."\n";
        !            19: 
        !            20: $dom->firstChild->setAttribute('pre:type', 'bar2');
        !            21: $dom->firstChild->setAttribute('type', 'foo2');
        !            22: $dom->firstChild->setAttribute('post:type', 'baz');
        !            23: $dom->firstChild->setAttribute('new:type', 'baz2');
        !            24: 
        !            25: echo $dom->firstChild->getAttribute('type')."\n";
        !            26: echo $dom->firstChild->getAttribute('pre:type')."\n";
        !            27: echo $dom->firstChild->getAttribute('post:type')."\n";
        !            28: 
        !            29: $dom->firstChild->removeAttribute('pre:type');
        !            30: $dom->firstChild->removeAttribute('type');
        !            31: 
        !            32: echo $dom->firstChild->getAttribute('type')."\n";
        !            33: echo $dom->firstChild->getAttribute('pre:type')."\n";
        !            34: echo $dom->firstChild->getAttribute('post:type')."\n";
        !            35: echo $dom->firstChild->getAttribute('new:type');
        !            36: ?>
        !            37: --EXPECT--
        !            38: foo
        !            39: bar
        !            40: foo2
        !            41: bar2
        !            42: baz
        !            43: 
        !            44: 
        !            45: baz
        !            46: baz2

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