Skip to content

Commit eda23df

Browse files
committed
Skip test if libxml does not support GBK encoding
1 parent b537f01 commit eda23df

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ext/xmlwriter/tests/xmlwriter_toStream_encoding_gbk.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
XMLWriter::toStream() with encoding - test GBK
33
--EXTENSIONS--
44
xmlwriter
5+
--SKIPIF--
6+
<?php
7+
$h = fopen("php://output", "w");
8+
9+
$writer = XMLWriter::toStream($h);
10+
11+
libxml_use_internal_errors(true);
12+
$writer->startDocument(encoding: "GBK");
13+
14+
foreach (libxml_get_errors() as $error) {
15+
if (trim($error->message) === 'xmlTextWriterStartDocument : unsupported encoding') {
16+
die('skip libxml does not support GBK encoding');
17+
}
18+
}
19+
?>
520
--FILE--
621
<?php
722

0 commit comments

Comments
 (0)