xref: /PHP-5.5/ext/xmlwriter/tests/001.phpt (revision bcd9356d)
1--TEST--
2XMLWriter: libxml2 XML Writer, file buffer, flush
3--SKIPIF--
4<?php if (!extension_loaded("xmlwriter")) print "skip"; ?>
5--FILE--
6<?php
7/* $Id$ */
8
9$doc_dest = '001.xml';
10$xw = xmlwriter_open_uri($doc_dest);
11xmlwriter_start_document($xw, '1.0', 'UTF-8');
12xmlwriter_start_element($xw, "tag1");
13xmlwriter_end_document($xw);
14
15// Force to write and empty the buffer
16$output_bytes = xmlwriter_flush($xw, true);
17echo file_get_contents($doc_dest);
18unset($xw);
19unlink('001.xml');
20?>
21===DONE===
22--EXPECT--
23<?xml version="1.0" encoding="UTF-8"?>
24<tag1/>
25===DONE===
26