Skip to content

Commit e727fac

Browse files
mbniebergallpetk
authored andcommitted
Added test for xml_parser_set_option
- For skipping white space and triggering invalid encoding value error
1 parent 76703ae commit e727fac

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
xml_parser_free - Test setting skip whitespace and invalid encoding type
3+
--CREDITS--
4+
Mark Niebergall <[email protected]>
5+
PHP TestFest 2017 - UPHPU
6+
--SKIPIF--
7+
<?php
8+
if (!extension_loaded("xml")) {
9+
print "skip - XML extension not loaded";
10+
}
11+
?>
12+
--FILE--
13+
<?php
14+
15+
$xmlParser = xml_parser_create();
16+
17+
var_dump(xml_parser_set_option($xmlParser, XML_OPTION_SKIP_WHITE, 1));
18+
var_dump(xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'Invalid Encoding'));
19+
20+
?>
21+
--EXPECTF--
22+
bool(true)
23+
24+
Warning: xml_parser_set_option(): Unsupported target encoding "Invalid Encoding" in %s on line %d
25+
bool(false)

0 commit comments

Comments
 (0)