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

1.1       misho       1: --TEST--
                      2: DOMDocument::validate() should validate an internal DTD declaration
                      3: --CREDITS--
                      4: Knut Urdalen <knut@php.net>
                      5: #PHPTestFest2009 Norway 2009-06-09 \o/
                      6: --SKIPIF--
                      7: <?php
                      8: require_once dirname(__FILE__) .'/skipif.inc';
                      9: ?>
                     10: --FILE--
                     11: <?php
                     12: $xml = "<?xml version=\"1.0\"?>
                     13: <!DOCTYPE note [
                     14: <!ELEMENT note (to,from,heading,body)>
                     15: <!ELEMENT to (#PCDATA)>
                     16: <!ELEMENT from (#PCDATA)>
                     17: <!ELEMENT heading (#PCDATA)>
                     18: <!ELEMENT body (#PCDATA)>
                     19: ]>
                     20: <note>
                     21: <to>Tove</to>
                     22: <from>Jani</from>
                     23: <heading>Reminder</heading>
                     24: <body>Don't forget me this weekend</body>
                     25: </note>";
                     26: $dom = new DOMDocument('1.0');
                     27: $dom->loadXML($xml);
                     28: var_dump($dom->validate());
                     29: ?>
                     30: --EXPECTF--
                     31: bool(true)

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