mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.3'
* PHP-8.3: Fix GH-13517: Multiple test failures when building with --with-expat
This commit is contained in:
commit
4799321740
14 changed files with 206 additions and 267 deletions
|
@ -1,15 +1,17 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
ReflectionExtension::getDependencies()
|
ReflectionExtension::getDependencies()
|
||||||
--EXTENSIONS--
|
--EXTENSIONS--
|
||||||
xml
|
dom
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
$ext = new ReflectionExtension("xml");
|
$ext = new ReflectionExtension("dom");
|
||||||
$deps = $ext->getDependencies();
|
$deps = $ext->getDependencies();
|
||||||
var_dump($deps);
|
var_dump($deps);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
array(1) {
|
array(2) {
|
||||||
["libxml"]=>
|
["libxml"]=>
|
||||||
string(8) "Required"
|
string(8) "Required"
|
||||||
|
["domxml"]=>
|
||||||
|
string(9) "Conflicts"
|
||||||
}
|
}
|
||||||
|
|
73
ext/xml/tests/bug26614.inc
Normal file
73
ext/xml/tests/bug26614.inc
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
this test has different output on libxml2 (even depending on the version) and Expat
|
||||||
|
|
||||||
|
further investigation has shown that not only line count
|
||||||
|
is skippet on CDATA sections but that libxml does also
|
||||||
|
show different column numbers and byte positions depending
|
||||||
|
on context and in opposition to what one would expect to
|
||||||
|
see and what good old Expat reported just fine ...
|
||||||
|
*/
|
||||||
|
|
||||||
|
$xmls = array();
|
||||||
|
|
||||||
|
// Case 1: CDATA Sections
|
||||||
|
$xmls["CDATA"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
||||||
|
<data>
|
||||||
|
<![CDATA[
|
||||||
|
multi
|
||||||
|
line
|
||||||
|
CDATA
|
||||||
|
block
|
||||||
|
]]>
|
||||||
|
</data>';
|
||||||
|
|
||||||
|
// Case 2: replace some characters so that we get comments instead
|
||||||
|
$xmls["Comment"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
||||||
|
<data>
|
||||||
|
<!-- ATA[
|
||||||
|
multi
|
||||||
|
line
|
||||||
|
CDATA
|
||||||
|
block
|
||||||
|
-->
|
||||||
|
</data>';
|
||||||
|
|
||||||
|
// Case 3: replace even more characters so that only textual data is left
|
||||||
|
$xmls["Text"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
||||||
|
<data>
|
||||||
|
-!-- ATA[
|
||||||
|
multi
|
||||||
|
line
|
||||||
|
CDATA
|
||||||
|
block
|
||||||
|
---
|
||||||
|
</data>';
|
||||||
|
|
||||||
|
function startElement($parser, $name, $attrs) {
|
||||||
|
printf("<$name> at line %d, col %d (byte %d)\n",
|
||||||
|
xml_get_current_line_number($parser),
|
||||||
|
xml_get_current_column_number($parser),
|
||||||
|
xml_get_current_byte_index($parser));
|
||||||
|
}
|
||||||
|
|
||||||
|
function endElement($parser, $name) {
|
||||||
|
printf("</$name> at line %d, col %d (byte %d)\n",
|
||||||
|
xml_get_current_line_number($parser),
|
||||||
|
xml_get_current_column_number($parser),
|
||||||
|
xml_get_current_byte_index($parser));
|
||||||
|
}
|
||||||
|
|
||||||
|
function characterData($parser, $data) {
|
||||||
|
// dummy
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($xmls as $desc => $xml) {
|
||||||
|
echo "$desc\n";
|
||||||
|
$xml_parser = xml_parser_create();
|
||||||
|
xml_set_element_handler($xml_parser, "startElement", "endElement");
|
||||||
|
xml_set_character_data_handler($xml_parser, "characterData");
|
||||||
|
if (!xml_parse($xml_parser, $xml, true))
|
||||||
|
echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n";
|
||||||
|
xml_parser_free($xml_parser);
|
||||||
|
}
|
|
@ -4,91 +4,20 @@ Bug #26614 (CDATA sections skipped on line count)
|
||||||
xml
|
xml
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php
|
<?php
|
||||||
if (defined("LIBXML_VERSION")) die('skip expat test');
|
require __DIR__ . '/libxml_expat_skipif.inc';
|
||||||
|
skipif(want_expat: true);
|
||||||
?>
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
/*
|
require __DIR__ . '/bug26614.inc';
|
||||||
this test works fine with Expat but fails with libxml
|
|
||||||
which we now use as default
|
|
||||||
|
|
||||||
further investigation has shown that not only line count
|
|
||||||
is skippet on CDATA sections but that libxml does also
|
|
||||||
show different column numbers and byte positions depending
|
|
||||||
on context and in opposition to what one would expect to
|
|
||||||
see and what good old Expat reported just fine ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
$xmls = array();
|
|
||||||
|
|
||||||
// Case 1: CDATA Sections
|
|
||||||
$xmls["CDATA"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
<![CDATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
]]>
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
// Case 2: replace some characters so that we get comments instead
|
|
||||||
$xmls["Comment"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
<!-- ATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
-->
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
// Case 3: replace even more characters so that only textual data is left
|
|
||||||
$xmls["Text"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
-!-- ATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
---
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
function startElement($parser, $name, $attrs) {
|
|
||||||
printf("<$name> at line %d, col %d (byte %d)\n",
|
|
||||||
xml_get_current_line_number($parser),
|
|
||||||
xml_get_current_column_number($parser),
|
|
||||||
xml_get_current_byte_index($parser));
|
|
||||||
}
|
|
||||||
|
|
||||||
function endElement($parser, $name) {
|
|
||||||
printf("</$name> at line %d, col %d (byte %d)\n",
|
|
||||||
xml_get_current_line_number($parser),
|
|
||||||
xml_get_current_column_number($parser),
|
|
||||||
xml_get_current_byte_index($parser));
|
|
||||||
}
|
|
||||||
|
|
||||||
function characterData($parser, $data) {
|
|
||||||
// dummy
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($xmls as $desc => $xml) {
|
|
||||||
echo "$desc\n";
|
|
||||||
$xml_parser = xml_parser_create();
|
|
||||||
xml_set_element_handler($xml_parser, "startElement", "endElement");
|
|
||||||
xml_set_character_data_handler($xml_parser, "characterData");
|
|
||||||
if (!xml_parse($xml_parser, $xml, true))
|
|
||||||
echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n";
|
|
||||||
xml_parser_free($xml_parser);
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
CDATA
|
CDATA
|
||||||
<DATA> at line 2, col 0 (byte 45)
|
<DATA> at line 2, col 0 (byte 45)
|
||||||
</DATA> at line 9, col 0 (byte 90)
|
</DATA> at line 9, col 0 (byte 89)
|
||||||
Comment
|
Comment
|
||||||
<DATA> at line 2, col 0 (byte 45)
|
<DATA> at line 2, col 0 (byte 45)
|
||||||
</DATA> at line 9, col 0 (byte 90)
|
</DATA> at line 9, col 0 (byte 89)
|
||||||
Text
|
Text
|
||||||
<DATA> at line 2, col 0 (byte 45)
|
<DATA> at line 2, col 0 (byte 45)
|
||||||
</DATA> at line 9, col 0 (byte 90)
|
</DATA> at line 9, col 0 (byte 89)
|
||||||
|
|
|
@ -4,84 +4,13 @@ Bug #26614 (CDATA sections skipped on line count)
|
||||||
xml
|
xml
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php
|
<?php
|
||||||
if (!defined("LIBXML_VERSION")) die('skip libxml2 test');
|
require __DIR__ . '/libxml_expat_skipif.inc';
|
||||||
|
skipif(want_expat: false);
|
||||||
if (LIBXML_VERSION < 21100) die('skip libxml2 test variant for version >= 2.11');
|
if (LIBXML_VERSION < 21100) die('skip libxml2 test variant for version >= 2.11');
|
||||||
?>
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
/*
|
require __DIR__ . '/bug26614.inc';
|
||||||
this test works fine with Expat but fails with libxml
|
|
||||||
which we now use as default
|
|
||||||
|
|
||||||
further investigation has shown that not only line count
|
|
||||||
is skipped on CDATA sections but that libxml does also
|
|
||||||
show different column numbers and byte positions depending
|
|
||||||
on context and in opposition to what one would expect to
|
|
||||||
see and what good old Expat reported just fine ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
$xmls = array();
|
|
||||||
|
|
||||||
// Case 1: CDATA Sections
|
|
||||||
$xmls["CDATA"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
<![CDATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
]]>
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
// Case 2: replace some characters so that we get comments instead
|
|
||||||
$xmls["Comment"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
<!-- ATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
-->
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
// Case 3: replace even more characters so that only textual data is left
|
|
||||||
$xmls["Text"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
-!-- ATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
---
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
function startElement($parser, $name, $attrs) {
|
|
||||||
printf("<$name> at line %d, col %d (byte %d)\n",
|
|
||||||
xml_get_current_line_number($parser),
|
|
||||||
xml_get_current_column_number($parser),
|
|
||||||
xml_get_current_byte_index($parser));
|
|
||||||
}
|
|
||||||
|
|
||||||
function endElement($parser, $name) {
|
|
||||||
printf("</$name> at line %d, col %d (byte %d)\n",
|
|
||||||
xml_get_current_line_number($parser),
|
|
||||||
xml_get_current_column_number($parser),
|
|
||||||
xml_get_current_byte_index($parser));
|
|
||||||
}
|
|
||||||
|
|
||||||
function characterData($parser, $data) {
|
|
||||||
// dummy
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($xmls as $desc => $xml) {
|
|
||||||
echo "$desc\n";
|
|
||||||
$xml_parser = xml_parser_create();
|
|
||||||
xml_set_element_handler($xml_parser, "startElement", "endElement");
|
|
||||||
xml_set_character_data_handler($xml_parser, "characterData");
|
|
||||||
if (!xml_parse($xml_parser, $xml, true))
|
|
||||||
echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n";
|
|
||||||
xml_parser_free($xml_parser);
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
CDATA
|
CDATA
|
||||||
|
|
|
@ -4,84 +4,13 @@ Bug #26614 (CDATA sections skipped on line count)
|
||||||
xml
|
xml
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php
|
<?php
|
||||||
if (!defined("LIBXML_VERSION")) die('skip libxml2 test');
|
require __DIR__ . '/libxml_expat_skipif.inc';
|
||||||
|
skipif(want_expat: false);
|
||||||
if (LIBXML_VERSION >= 21100) die('skip libxml2 test variant for version < 2.11');
|
if (LIBXML_VERSION >= 21100) die('skip libxml2 test variant for version < 2.11');
|
||||||
?>
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
/*
|
require __DIR__ . '/bug26614.inc';
|
||||||
this test works fine with Expat but fails with libxml
|
|
||||||
which we now use as default
|
|
||||||
|
|
||||||
further investigation has shown that not only line count
|
|
||||||
is skipped on CDATA sections but that libxml does also
|
|
||||||
show different column numbers and byte positions depending
|
|
||||||
on context and in opposition to what one would expect to
|
|
||||||
see and what good old Expat reported just fine ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
$xmls = array();
|
|
||||||
|
|
||||||
// Case 1: CDATA Sections
|
|
||||||
$xmls["CDATA"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
<![CDATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
]]>
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
// Case 2: replace some characters so that we get comments instead
|
|
||||||
$xmls["Comment"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
<!-- ATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
-->
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
// Case 3: replace even more characters so that only textual data is left
|
|
||||||
$xmls["Text"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
|
|
||||||
<data>
|
|
||||||
-!-- ATA[
|
|
||||||
multi
|
|
||||||
line
|
|
||||||
CDATA
|
|
||||||
block
|
|
||||||
---
|
|
||||||
</data>';
|
|
||||||
|
|
||||||
function startElement($parser, $name, $attrs) {
|
|
||||||
printf("<$name> at line %d, col %d (byte %d)\n",
|
|
||||||
xml_get_current_line_number($parser),
|
|
||||||
xml_get_current_column_number($parser),
|
|
||||||
xml_get_current_byte_index($parser));
|
|
||||||
}
|
|
||||||
|
|
||||||
function endElement($parser, $name) {
|
|
||||||
printf("</$name> at line %d, col %d (byte %d)\n",
|
|
||||||
xml_get_current_line_number($parser),
|
|
||||||
xml_get_current_column_number($parser),
|
|
||||||
xml_get_current_byte_index($parser));
|
|
||||||
}
|
|
||||||
|
|
||||||
function characterData($parser, $data) {
|
|
||||||
// dummy
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($xmls as $desc => $xml) {
|
|
||||||
echo "$desc\n";
|
|
||||||
$xml_parser = xml_parser_create();
|
|
||||||
xml_set_element_handler($xml_parser, "startElement", "endElement");
|
|
||||||
xml_set_character_data_handler($xml_parser, "characterData");
|
|
||||||
if (!xml_parse($xml_parser, $xml, true))
|
|
||||||
echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n";
|
|
||||||
xml_parser_free($xml_parser);
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
CDATA
|
CDATA
|
||||||
|
|
|
@ -27,8 +27,8 @@ xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
|
||||||
xml_parse($parser, $xml);
|
xml_parse($parser, $xml);
|
||||||
xml_parser_free($parser);
|
xml_parser_free($parser);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECTF--
|
||||||
<a xmlns="http://example.com/foo" xmlns:bar="http://example.com/bar">
|
<a xmlns="http://example.com/foo"%axmlns:bar="http://example.com/bar">
|
||||||
<bar:b foo="bar">1</bar:b>
|
<bar:b foo="bar">1</bar:b>
|
||||||
<bar:c bar:nix="null" foo="bar">2</bar:c>
|
<bar:c bar:nix="null" foo="bar">2</bar:c>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -22,5 +22,5 @@ $error = xml_error_string($code);
|
||||||
echo "xml_parse returned $success, xml_get_error_code = $code, xml_error_string = $error\r\n";
|
echo "xml_parse returned $success, xml_get_error_code = $code, xml_error_string = $error\r\n";
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
xml_parse returned 1, xml_get_error_code = 0, xml_error_string = No error
|
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 = 77, xml_error_string = Tag not finished%r
|
%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
|
||||||
|
|
9
ext/xml/tests/libxml_expat_skipif.inc
Normal file
9
ext/xml/tests/libxml_expat_skipif.inc
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
function skipif(bool $want_expat) {
|
||||||
|
ob_start();
|
||||||
|
echo phpinfo(INFO_MODULES);
|
||||||
|
$output = ob_get_clean();
|
||||||
|
if ($want_expat !== str_contains($output, 'EXPAT')) {
|
||||||
|
die('skip test is for ' . ($want_expat ? 'Expat' : 'libxml'));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,3 @@
|
||||||
--TEST--
|
|
||||||
xml_error_string() - Basic test on 5 error codes
|
|
||||||
--EXTENSIONS--
|
|
||||||
xml
|
|
||||||
--FILE--
|
|
||||||
<?php
|
<?php
|
||||||
$xmls = array(
|
$xmls = array(
|
||||||
'<?xml version="1.0"?><element>',
|
'<?xml version="1.0"?><element>',
|
||||||
|
@ -19,16 +14,4 @@ foreach ($xmls as $xml) {
|
||||||
var_dump(xml_error_string(xml_get_error_code($xml_parser)));
|
var_dump(xml_error_string(xml_get_error_code($xml_parser)));
|
||||||
}
|
}
|
||||||
xml_parser_free($xml_parser);
|
xml_parser_free($xml_parser);
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
--EXPECTF--
|
|
||||||
int(%r5|77%r)
|
|
||||||
string(%d) %r"Invalid document end"|"Tag not finished"%r
|
|
||||||
int(47)
|
|
||||||
string(35) "Processing Instruction not finished"
|
|
||||||
int(57)
|
|
||||||
string(28) "XML declaration not finished"
|
|
||||||
int(64)
|
|
||||||
string(17) "Reserved XML Name"
|
|
||||||
int(76)
|
|
||||||
string(14) "Mismatched tag"
|
|
24
ext/xml/tests/xml_error_string_basic_expat.phpt
Normal file
24
ext/xml/tests/xml_error_string_basic_expat.phpt
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
--TEST--
|
||||||
|
xml_error_string() - Basic test on 5 error codes
|
||||||
|
--EXTENSIONS--
|
||||||
|
xml
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
require __DIR__ . '/libxml_expat_skipif.inc';
|
||||||
|
skipif(want_expat: true);
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
require __DIR__ . '/xml_error_string_basic.inc';
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
int(3)
|
||||||
|
string(16) "no element found"
|
||||||
|
int(4)
|
||||||
|
string(31) "not well-formed (invalid token)"
|
||||||
|
int(5)
|
||||||
|
string(14) "unclosed token"
|
||||||
|
int(30)
|
||||||
|
string(31) "XML declaration not well-formed"
|
||||||
|
int(7)
|
||||||
|
string(14) "mismatched tag"
|
24
ext/xml/tests/xml_error_string_basic_libxml.phpt
Normal file
24
ext/xml/tests/xml_error_string_basic_libxml.phpt
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
--TEST--
|
||||||
|
xml_error_string() - Basic test on 5 error codes
|
||||||
|
--EXTENSIONS--
|
||||||
|
xml
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
require __DIR__ . '/libxml_expat_skipif.inc';
|
||||||
|
skipif(want_expat: false);
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
require __DIR__ . '/xml_error_string_basic.inc';
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
int(%r5|77%r)
|
||||||
|
string(%d) %r"Invalid document end"|"Tag not finished"%r
|
||||||
|
int(47)
|
||||||
|
string(35) "Processing Instruction not finished"
|
||||||
|
int(57)
|
||||||
|
string(28) "XML declaration not finished"
|
||||||
|
int(64)
|
||||||
|
string(17) "Reserved XML Name"
|
||||||
|
int(76)
|
||||||
|
string(14) "Mismatched tag"
|
|
@ -1,8 +1,3 @@
|
||||||
--TEST--
|
|
||||||
Test xml_set_start_namespace_decl_handler function: basic
|
|
||||||
--EXTENSIONS--
|
|
||||||
xml
|
|
||||||
--FILE--
|
|
||||||
<?php
|
<?php
|
||||||
$xml = <<<HERE
|
$xml = <<<HERE
|
||||||
<aw1:book xmlns:aw1="http://www.somewhere.com/namespace1"
|
<aw1:book xmlns:aw1="http://www.somewhere.com/namespace1"
|
||||||
|
@ -36,15 +31,4 @@ function Namespace_End_Handler($parser, $prefix) {
|
||||||
|
|
||||||
function DefaultHandler( $parser, $data ) {
|
function DefaultHandler( $parser, $data ) {
|
||||||
print( 'DefaultHandler Called<br/>' );
|
print( 'DefaultHandler Called<br/>' );
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
--EXPECT--
|
|
||||||
bool(true)
|
|
||||||
bool(true)
|
|
||||||
Namespace_Start_Handler called
|
|
||||||
...Prefix: aw1
|
|
||||||
...Uri: http://www.somewhere.com/namespace1
|
|
||||||
Namespace_Start_Handler called
|
|
||||||
...Prefix: aw2
|
|
||||||
...Uri: file:/DTD/somewhere.dtd
|
|
||||||
Done
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
--TEST--
|
||||||
|
Test xml_set_start_namespace_decl_handler function: basic
|
||||||
|
--EXTENSIONS--
|
||||||
|
xml
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
require __DIR__ . '/libxml_expat_skipif.inc';
|
||||||
|
skipif(want_expat: true);
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
require __DIR__ . '/xml_set_start_namespace_decl_handler_basic.inc';
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
bool(true)
|
||||||
|
bool(true)
|
||||||
|
Namespace_Start_Handler called
|
||||||
|
...Prefix: aw1
|
||||||
|
...Uri: http://www.somewhere.com/namespace1
|
||||||
|
Namespace_Start_Handler called
|
||||||
|
...Prefix: aw2
|
||||||
|
...Uri: file:/DTD/somewhere.dtd
|
||||||
|
Namespace_End_Handler called
|
||||||
|
...Prefix: aw2
|
||||||
|
|
||||||
|
Namespace_End_Handler called
|
||||||
|
...Prefix: aw1
|
||||||
|
|
||||||
|
Done
|
|
@ -0,0 +1,24 @@
|
||||||
|
--TEST--
|
||||||
|
Test xml_set_start_namespace_decl_handler function: basic
|
||||||
|
--EXTENSIONS--
|
||||||
|
xml
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
require __DIR__ . '/libxml_expat_skipif.inc';
|
||||||
|
skipif(want_expat: false);
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
// Note: namespace end handlers are only supported on expat
|
||||||
|
require __DIR__ . '/xml_set_start_namespace_decl_handler_basic.inc';
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
bool(true)
|
||||||
|
bool(true)
|
||||||
|
Namespace_Start_Handler called
|
||||||
|
...Prefix: aw1
|
||||||
|
...Uri: http://www.somewhere.com/namespace1
|
||||||
|
Namespace_Start_Handler called
|
||||||
|
...Prefix: aw2
|
||||||
|
...Uri: file:/DTD/somewhere.dtd
|
||||||
|
Done
|
Loading…
Add table
Add a link
Reference in a new issue