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