mirror of
https://github.com/php/php-src.git
synced 2026-04-24 00:18:23 +02:00
552ea62e1f
The reflection failure is because the XML extension is used to check the module dependency information, but that extension can be configured to not depend on ext/libxml, resulting in a different output. The solution is to check another extension instead. The test failures in ext/xml/tests are because of different behaviour between libxml2 and Expat error handling. These are expected differences and the solution is to split the tests. Closes GH-13522.
27 lines
1.1 KiB
PHP
27 lines
1.1 KiB
PHP
--TEST--
|
|
Bug #81351 (xml_parse may fail, but has no error code)
|
|
--EXTENSIONS--
|
|
xml
|
|
--FILE--
|
|
<?php
|
|
$xml = <<<XML
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
<soap:Body>
|
|
<X xmlns="example.org">
|
|
XML;
|
|
|
|
$parser = xml_parser_create_ns('UTF-8');
|
|
$success = xml_parse($parser, $xml, false);
|
|
$code = xml_get_error_code($parser);
|
|
$error = xml_error_string($code);
|
|
echo "xml_parse returned $success, xml_get_error_code = $code, xml_error_string = $error\r\n";
|
|
$success = xml_parse($parser, 'Y>', true);
|
|
$code = xml_get_error_code($parser);
|
|
$error = xml_error_string($code);
|
|
echo "xml_parse returned $success, xml_get_error_code = $code, xml_error_string = $error\r\n";
|
|
?>
|
|
--EXPECTF--
|
|
xml_parse returned 1, xml_get_error_code = 0, xml_error_string = %S
|
|
%rxml_parse returned 0, xml_get_error_code = 5, xml_error_string = Invalid document end|xml_parse returned 0, xml_get_error_code = 3, xml_error_string = no element found|xml_parse returned 0, xml_get_error_code = 77, xml_error_string = Tag not finished%r
|