bug70309.phpt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. XMLReader: 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. /* From the bug report an extra message comes from libxml2 debug output left unwrapped. */
  10. $doc = new \XMLReader();
  11. $doc->xml('<?xml version="1.0" encoding="UTF-8"?>
  12. <chapter xmlns="http://docbook.org/ns/docbook" version="5.0">
  13. <title>Test Chapter</title>
  14. <para>
  15. This is a paragraph in the test chapter. It is unremarkable in
  16. every regard. This is a paragraph in the test chapter. It is
  17. unremarkable in every regard. This is a paragraph in the test
  18. chapter. It is unremarkable in every regard.
  19. </para>
  20. <paar>
  21. <emphasis role="bold">This</emphasis> paragraph contains
  22. <emphasis>some <emphasis>emphasized</emphasis> text</emphasis>
  23. 1and a <superscript>super</superscript>script
  24. and a <subscript>sub</subscript>script.
  25. </para>
  26. <para>
  27. This is a paragraph in the test chapter. It is unremarkable in
  28. every regard. This is a paragraph in the test chapter. It is
  29. unremarkable in every regard. This is a paragraph in the test
  30. chapter. It is unremarkable in every regard.
  31. </para>
  32. </chapter>');
  33. $doc->setRelaxNGSchema('http://docs.oasis-open.org/docbook/rng/5.0/docbook.rng');
  34. while (@$doc->read() !== false);
  35. ?>
  36. ===DONE===
  37. --EXPECT--
  38. ===DONE===