1--TEST--
2DOMDocument::relaxNGValidateSource() should fail on invalid RNG schema
3--CREDITS--
4Knut Urdalen <knut@php.net>
5--EXTENSIONS--
6dom
7--FILE--
8<?php
9$rng = <<< RNG
10<?xml version="1.0" encoding="UTF-8"?>
11<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0"
12  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
13  <start>
14    <element name="apple">
15    </element>
16  </start>
17</grammar>
18RNG;
19
20$xml = <<< XML
21<?xml version="1.0"?>
22<apple>
23  <pear>Pear</pear>
24</apple>
25XML;
26
27$doc = new DOMDocument();
28$doc->loadXML($xml);
29$result = $doc->relaxNGValidateSource($rng);
30var_dump($result);
31
32?>
33--EXPECTF--
34Warning: DOMDocument::relaxNGValidateSource(): xmlRelaxNGParseElement: element has no content in %s on line %d
35
36Warning: DOMDocument::relaxNGValidateSource(): Invalid RelaxNG in %s on line %d
37bool(false)
38