xref: /PHP-7.4/ext/xmlwriter/tests/OO_001.phpt (revision 832b89d1)
1--TEST--
2XMLWriter: libxml2 XML Writer, file buffer, flush
3--SKIPIF--
4<?php if (!extension_loaded("xmlwriter")) print "skip"; ?>
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===DONE===
22--EXPECT--
23<?xml version="1.0" encoding="UTF-8" standalone="standalonearg"?>
24<tag1/>
25===DONE===
26