Annotation of embedaddon/php/ext/xmlwriter/tests/bug39504.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("xmlwriter")) die("skip");
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9:
! 10: $xw = xmlwriter_open_memory();
! 11: xmlwriter_start_document($xw, NULL, "UTF-8");
! 12: xmlwriter_start_dtd($xw, "root");
! 13: xmlwriter_write_dtd_entity($xw, "ent2", "val2");
! 14: xmlwriter_end_dtd($xw);
! 15: xmlwriter_start_element($xw, "root");
! 16: xmlwriter_end_document($xw);
! 17: print xmlwriter_flush($xw, true);
! 18: print "\n";
! 19:
! 20: $xw = new XMLWriter();
! 21: $xw->openMemory();
! 22: $xw->startDocument(NULL, "UTF-8");
! 23: $xw->startDtd("root");
! 24: $xw->writeDtdEntity("c", NULL, 0, "-//W3C//TEXT copyright//EN", "http://www.w3.org/xmlspec/copyright.xml");
! 25: $xw->endDtd();
! 26: $xw->startElement("root");
! 27: $xw->endDocument();
! 28: print $xw->flush(true);
! 29:
! 30: ?>
! 31: --EXPECTF--
! 32: <?xml version="1.0" encoding="UTF-8"?>
! 33: <!DOCTYPE root [<!ENTITY ent2 "val2">]><root/>
! 34:
! 35: <?xml version="1.0" encoding="UTF-8"?>
! 36: <!DOCTYPE root [<!ENTITY c PUBLIC "-//W3C//TEXT copyright//EN" "http://www.w3.org/xmlspec/copyright.xml">]><root/>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>