Annotation of embedaddon/php/ext/xmlreader/tests/bug64230.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #64230 (XMLReader does not suppress errors)
3: --SKIPIF--
4: <?php
5: extension_loaded("xmlreader") or die("skip requires xmlreader");
6: ?>
7: --FILE--
8: <?php
9: echo "Test\n";
10:
11: function show_internal_errors() {
12: foreach (libxml_get_errors() as $error) {
13: printf("Internal: %s\n", $error->message);
14: }
15: libxml_clear_errors();
16: }
17:
18: echo "Internal errors TRUE\n";
19: libxml_use_internal_errors(true);
20:
21: $x = new XMLReader;
22: $x->xml("<root att/>");
23: $x->read();
24:
25: show_internal_errors();
26:
27: echo "Internal errors FALSE\n";
28: libxml_use_internal_errors(false);
29:
30: $x = new XMLReader;
31: $x->xml("<root att/>");
32: $x->read();
33:
34: show_internal_errors();
35:
36: ?>
37: Done
38: --EXPECTF--
39: Test
40: Internal errors TRUE
41: Internal: Specification mandate value for attribute att
42:
43: Internal errors FALSE
44:
45: Warning: XMLReader::read(): %s: parser error : Specification mandate value for attribute att in %s on line %d
46:
47: Warning: XMLReader::read(): <root att/> in %s on line %d
48:
49: Warning: XMLReader::read(): ^ in %s on line %d
50: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>