Annotation of embedaddon/php/ext/dom/tests/DOMDocument_relaxNGValidateSource_error2.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: DOMDocument::relaxNGValidateSource() should fail on invalid RNG schema
                      3: --CREDITS--
                      4: Knut Urdalen <knut@php.net>
                      5: --SKIPIF--
                      6: <?php
                      7: require_once('skipif.inc');
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: $rng = <<< RNG
                     12: <?xml version="1.0" encoding="UTF-8"?> 
                     13: <grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" 
                     14:   datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
                     15:   <start>
                     16:        <element name="apple">
                     17:     </element>
                     18:   </start>
                     19: </grammar>
                     20: RNG;
                     21: 
                     22: $xml = <<< XML
                     23: <?xml version="1.0"?> 
                     24: <apple> 
                     25:   <pear>Pear</pear>
                     26: </apple>
                     27: XML;
                     28: 
                     29: $doc = new DOMDocument();
                     30: $doc->loadXML($xml);
                     31: $result = $doc->relaxNGValidateSource($rng);
                     32: var_dump($result);
                     33: 
                     34: ?>
                     35: --EXPECTF--
                     36: Warning: DOMDocument::relaxNGValidateSource(): xmlRelaxNGParseElement: element has no content in %s on line %d
                     37: 
                     38: Warning: DOMDocument::relaxNGValidateSource(): Invalid RelaxNG in %s on line %d
                     39: bool(false)

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