xref: /PHP-7.2/ext/xmlreader/tests/bug70309.phpt (revision f9ae74a4)
1--TEST--
2XMLReader: Bug #70309 XmlReader read generates extra output
3--SKIPIF--
4<?php if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. only for Windows'); ?>
5<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
6<?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); ?>
7--FILE--
8<?php
9
10/* From the bug report an extra message comes from libxml2 debug output left unwrapped. */
11
12$doc = new \XMLReader();
13
14$doc->xml('<?xml version="1.0" encoding="UTF-8"?>
15<chapter xmlns="http://docbook.org/ns/docbook" version="5.0">
16<title>Test Chapter</title>
17<para>
18This is a paragraph in the test chapter. It is unremarkable in
19every regard. This is a paragraph in the test chapter. It is
20unremarkable in every regard. This is a paragraph in the test
21chapter. It is unremarkable in every regard.
22</para>
23<paar>
24<emphasis role="bold">This</emphasis> paragraph contains
25<emphasis>some <emphasis>emphasized</emphasis> text</emphasis>
261and a <superscript>super</superscript>script
27and a <subscript>sub</subscript>script.
28</para>
29<para>
30This is a paragraph in the test chapter. It is unremarkable in
31every regard. This is a paragraph in the test chapter. It is
32unremarkable in every regard. This is a paragraph in the test
33chapter. It is unremarkable in every regard.
34</para>
35</chapter>');
36
37$doc->setRelaxNGSchema('http://docs.oasis-open.org/docbook/rng/5.0/docbook.rng');
38
39while (@$doc->read() !== false);
40?>
41===DONE===
42--EXPECTF--
43===DONE===
44