001.phpt 545 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. XMLReader: libxml2 XML Reader, string data
  3. --SKIPIF--
  4. <?php if (!extension_loaded("xmlreader")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. /* $Id$ */
  8. $xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
  9. <books></books>';
  10. $reader = new XMLReader();
  11. $reader->XML($xmlstring);
  12. // Only go through
  13. while ($reader->read()) {
  14. echo $reader->name."\n";
  15. }
  16. $xmlstring = '';
  17. $reader = new XMLReader();
  18. $reader->XML($xmlstring);
  19. ?>
  20. ===DONE===
  21. --EXPECTF--
  22. books
  23. books
  24. Warning: XMLReader::XML(): Empty string supplied as input in %s on line %d
  25. ===DONE===