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