xref: /PHP-8.3/ext/xmlwriter/tests/OO_001.phpt (revision 74859783)
1--TEST--
2XMLWriter: libxml2 XML Writer, file buffer, flush
3--EXTENSIONS--
4xmlwriter
5--FILE--
6<?php
7
8$doc_dest = 'OO_001.xml';
9$xw = new XMLWriter();
10$xw->openUri($doc_dest);
11$xw->startDocument('1.0', 'UTF-8', 'standalonearg');
12$xw->startElement("tag1");
13$xw->endDocument();
14
15// Force to write and empty the buffer
16$output_bytes = $xw->flush(true);
17echo file_get_contents($doc_dest);
18unset($xw);
19unlink($doc_dest);
20?>
21--EXPECT--
22<?xml version="1.0" encoding="UTF-8" standalone="standalonearg"?>
23<tag1/>
24