Skip to content

Commit b9a43ad

Browse files
committed
Adapt tests for libxml2 >= 2.13.0
libxml2 2.13.0 introduced some relevant changes regarding the treatment of file paths on Windows[1]. Thus we un-xfail bug69753.phpt and its companion, and we adjust dom004.phpt. [1] <https://gitlab.gnome.org/GNOME/libxml2/-/commit/8ab1b122c47bfced2b59f52351507ebc1eb50218>
1 parent cfd954f commit b9a43ad

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

ext/dom/tests/dom004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ in_array('compress.zlib', stream_get_wrappers()) or die('skip compress.zlib wrap
99
--FILE--
1010
<?php
1111
$dom = new domdocument;
12-
$dom->load("compress.zlib://".__DIR__."/book.xml.gz");
12+
$dom->load("compress.zlib://" . str_replace("\\", "/", __DIR__) . "/book.xml.gz");
1313
print $dom->saveXML();
1414
?>
1515
--EXPECT--

ext/libxml/tests/bug69753-mb.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
--TEST--
22
Bug #69753 - libXMLError::file contains invalid URI
3-
--XFAIL--
4-
Awaiting upstream fix: https://gitlab.gnome.org/GNOME/libxml2/-/issues/611
53
--EXTENSIONS--
64
dom
75
--SKIPIF--
86
<?php
97
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
8+
if (version_compare(LIBXML_DOTTED_VERSION, "2.13.0") < 0) die("skip fails for libxml2 < 2.13.0; https://gitlab.gnome.org/GNOME/libxml2/-/issues/611");
109
?>
1110
--FILE--
1211
<?php
@@ -17,4 +16,4 @@ $error = libxml_get_last_error();
1716
var_dump($error->file);
1817
?>
1918
--EXPECTF--
20-
string(%d) "file:///%s/ext/libxml/tests/bug69753.xml"
19+
string(%d) "%s\ext\libxml\tests\bug69753私はガラスを食べられます.xml"

ext/libxml/tests/bug69753.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
--TEST--
22
Bug #69753 - libXMLError::file contains invalid URI
3-
--XFAIL--
4-
Awaiting upstream fix: https://gitlab.gnome.org/GNOME/libxml2/-/issues/611
53
--EXTENSIONS--
64
dom
75
--SKIPIF--
86
<?php
97
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
8+
if (version_compare(LIBXML_DOTTED_VERSION, "2.13.0") < 0) die("skip fails for libxml2 < 2.13.0; https://gitlab.gnome.org/GNOME/libxml2/-/issues/611");
109
?>
1110
--FILE--
1211
<?php
@@ -17,4 +16,4 @@ $error = libxml_get_last_error();
1716
var_dump($error->file);
1817
?>
1918
--EXPECTF--
20-
string(%d) "file:///%s/ext/libxml/tests/bug69753.xml"
19+
string(%d) "%s\ext\libxml\tests\bug69753.xml"

0 commit comments

Comments
 (0)