Skip to content

Commit f209eb4

Browse files
committedMar 10, 2025
Fix tests for libxml2 2.14
See GH-18009.
1 parent ee7fcf2 commit f209eb4

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed
 

‎ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Antonio Diaz Ruiz <dejalatele@gmail.com>
88
assert.bail=true
99
--EXTENSIONS--
1010
dom
11+
--SKIPIF--
12+
<?php
13+
if (LIBXML_VERSION >= 21400) die("skip libxml >= 2.14 no longer has this non-standard warning");
14+
?>
1115
--FILE--
1216
<?php
1317
$doc = new DOMDocument();

‎ext/dom/tests/bug69679.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ $html = "<!DOCTYPE html><html><head><meta charset='UTF-8'></head><body>U+0000 <s
99
$doc->loadHTML($html);
1010
print($doc->saveHTML());
1111
?>
12-
--EXPECT--
12+
--EXPECTF--
1313
<!DOCTYPE html>
14-
<html><head><meta charset="UTF-8"></head><body>U+0000 <span></span></body></html>
14+
<html><head><meta charset="UTF-8"></head><body>U+0000 <span>%r(&#65533;|)%r</span></body></html>

‎ext/dom/tests/bug78025.phpt

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ dom
66
<?php
77
$htm = "<!DOCTYPE><html></html>";
88
$dom = new DOMDocument;
9-
$dom->loadHTML($htm);
9+
$dom->loadHTML($htm, LIBXML_NOERROR);
1010
var_dump($dom->doctype->name);
1111
?>
1212
--EXPECTF--
13-
Warning: DOMDocument::loadHTML(): htmlParseDocTypeDecl : no DOCTYPE name ! in Entity, line: 1 in %s on line %d
1413
string(0) ""

‎ext/dom/tests/bug80268_2.phpt

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ if (LIBXML_VERSION < 20912) die('skip For libxml2 >= 2.9.12 only');
99
--FILE--
1010
<?php
1111
$doc = new DOMDocument;
12-
$doc->loadHTML("<p>foo\0bar</p>");
12+
$doc->loadHTML("<p>foo\0bar</p>", LIBXML_NOERROR);
1313
$html = $doc->saveHTML();
1414
var_dump(strpos($html, '<p>foo</p>') !== false);
1515

1616
file_put_contents(__DIR__ . '/80268.html', "<p>foo\0bar</p>");
1717
$doc = new DOMDocument;
18-
$doc->loadHTMLFile(__DIR__ . '/80268.html');
18+
$doc->loadHTMLFile(__DIR__ . '/80268.html', LIBXML_NOERROR);
1919
$html = $doc->saveHTML();
2020
var_dump(strpos($html, '<p>foo</p>') !== false);
2121
?>
@@ -24,8 +24,5 @@ var_dump(strpos($html, '<p>foo</p>') !== false);
2424
unlink(__DIR__ . '/80268.html');
2525
?>
2626
--EXPECTF--
27-
Warning: DOMDocument::loadHTML(): Char 0x0 out of allowed range in Entity, line: 1 in %s on line %d
2827
bool(false)
29-
30-
Warning: DOMDocument::loadHTMLFile(): Char 0x0 out of allowed range in %s on line %d
3128
bool(false)

‎ext/simplexml/tests/bug51615.phpt

+2-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dom
77
<?php
88

99
$dom = new DOMDocument;
10-
$dom->loadHTML('<span title=""y">x</span><span title=""z">x</span>');
10+
$dom->loadHTML('<span title=""y">x</span><span title=""z">x</span>', LIBXML_NOERROR);
1111
$html = simplexml_import_dom($dom);
1212

1313
var_dump($html->body->span);
@@ -18,15 +18,12 @@ foreach ($html->body->span as $obj) {
1818

1919
?>
2020
--EXPECTF--
21-
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
22-
23-
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
2421
object(SimpleXMLElement)#%d (3) {
2522
["@attributes"]=>
2623
array(2) {
2724
["title"]=>
2825
string(0) ""
29-
["y"]=>
26+
[%r("y"{1,2})%r]=>
3027
string(0) ""
3128
}
3229
[0]=>

0 commit comments

Comments
 (0)
Failed to load comments.