xref: /PHP-7.1/ext/xmlreader/tests/005.phpt (revision 7af945e2)
1--TEST--
2XMLReader: libxml2 XML Reader, parser property set/get
3--SKIPIF--
4<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
5--FILE--
6<?php
7/* $Id$ */
8
9$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
10<books></books>';
11
12$reader = new XMLReader();
13
14$reader->XML($xmlstring);
15
16
17$a = $reader->setParserProperty(XMLReader::LOADDTD, false);
18$b = $reader->getParserProperty(XMLReader::LOADDTD);
19
20if (!$a && !$b) {
21	echo "ok\n";
22}
23
24$a = $reader->setParserProperty(XMLReader::SUBST_ENTITIES, true);
25$b = $reader->getParserProperty(XMLReader::SUBST_ENTITIES);
26
27if ($a && $b) {
28	echo "ok\n";
29}
30// Only go through
31while ($reader->read());
32$reader->close();
33?>
34===DONE===
35--EXPECT--
36ok
37===DONE===
38