xref: /PHP-7.3/ext/xmlreader/tests/011.phpt (revision 782352c5)
1--TEST--
2XMLReader: libxml2 XML Reader, string data
3--SKIPIF--
4<?php if (!extension_loaded("xmlreader")) print "skip";
5$reader = new XMLReader();
6if (!method_exists($reader, 'readInnerXml')) print "skip";
7?>
8--FILE--
9<?php
10
11$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
12<books><book>test</book></books>';
13
14$reader = new XMLReader();
15$reader->XML($xmlstring);
16$reader->read();
17echo $reader->readInnerXml();
18echo "\n";
19$reader->close();
20
21
22$reader = new XMLReader();
23$reader->XML($xmlstring);
24$reader->read();
25echo $reader->readOuterXml();
26echo "\n";
27$reader->close();
28?>
29===DONE===
30--EXPECT--
31<book>test</book>
32<books><book>test</book></books>
33===DONE===
34