1--TEST--
2XMLReader: setSchema Error
3--EXTENSIONS--
4xmlreader
5--FILE--
6<?php
7
8$reader = new XMLReader();
9try {
10    $reader->setSchema('');
11} catch (ValueError $exception) {
12    echo $exception->getMessage() . "\n";
13}
14$reader->close();
15
16$reader = new XMLReader();
17try {
18    $reader->setSchema('schema-missing-file.xsd');
19} catch (Error $exception) {
20    echo $exception->getMessage() . "\n";
21}
22$reader->close();
23
24$reader = new XMLReader();
25try {
26    $reader->setSchema('schema-empty.xsd');
27} catch (Error $exception) {
28    echo $exception->getMessage() . "\n";
29}
30
31$reader = new XMLReader();
32$reader->XML(<<<EOF
33<?xml version="1.0" encoding="UTF-8" ?>
34<foo/>
35EOF);
36var_dump(@$reader->setSchema('schema-bad.xsd'));
37$reader->close();
38?>
39--EXPECT--
40XMLReader::setSchema(): Argument #1 ($filename) cannot be empty
41Schema must be set prior to reading
42Schema must be set prior to reading
43bool(false)
44