"Fossies" - the Fresh Open Source Software Archive

Member "php-7.2.27/ext/xmlwriter/tests/001.phpt" (22 Jan 2020, 563 Bytes) of package /linux/www/php-7.2.27.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "001.phpt": 7.3.12_vs_7.4.0.

    1 --TEST--
    2 XMLWriter: 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);
   11 xmlwriter_start_document($xw, '1.0', 'UTF-8');
   12 xmlwriter_start_element($xw, "tag1");
   13 xmlwriter_end_document($xw);
   14 
   15 // Force to write and empty the buffer
   16 $output_bytes = xmlwriter_flush($xw, true);
   17 echo file_get_contents($doc_dest);
   18 unset($xw);
   19 unlink('001.xml');
   20 ?>
   21 ===DONE===
   22 --EXPECT--
   23 <?xml version="1.0" encoding="UTF-8"?>
   24 <tag1/>
   25 ===DONE===