xref: /PHP-7.2/ext/xmlreader/tests/011.phpt (revision 17ccbeec)
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/* $Id$ */
11
12$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
13<books><book>test</book></books>';
14
15$reader = new XMLReader();
16$reader->XML($xmlstring);
17$reader->read();
18echo $reader->readInnerXml();
19echo "\n";
20$reader->close();
21
22
23$reader = new XMLReader();
24$reader->XML($xmlstring);
25$reader->read();
26echo $reader->readOuterXml();
27echo "\n";
28$reader->close();
29?>
30===DONE===
31--EXPECT--
32<book>test</book>
33<books><book>test</book></books>
34===DONE===
35