bug70309.phpt 1.4 KB

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