mirror of
https://github.com/php/php-src.git
synced 2026-04-28 10:43:30 +02:00
Added test for xml_parser_set_option
- For skipping white space and triggering invalid encoding value error
This commit is contained in:
committed by
Peter Kokot
parent
76703ae5a1
commit
e727facd47
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
xml_parser_free - Test setting skip whitespace and invalid encoding type
|
||||
--CREDITS--
|
||||
Mark Niebergall <mbniebergall@gmail.com>
|
||||
PHP TestFest 2017 - UPHPU
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("xml")) {
|
||||
print "skip - XML extension not loaded";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$xmlParser = xml_parser_create();
|
||||
|
||||
var_dump(xml_parser_set_option($xmlParser, XML_OPTION_SKIP_WHITE, 1));
|
||||
var_dump(xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'Invalid Encoding'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
|
||||
Warning: xml_parser_set_option(): Unsupported target encoding "Invalid Encoding" in %s on line %d
|
||||
bool(false)
|
||||
Reference in New Issue
Block a user