Skip to content

Commit f806ca4

Browse files
committed
Review remarks
1 parent 7601d79 commit f806ca4

6 files changed

+25
-3
lines changed

ext/dom/tests/modern/html/encoding/HTMLDocument_createFromFile_override_encoding.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ try {
1111
echo $e->getMessage(), "\n";
1212
}
1313

14+
// The override encoding matches with the document encoding attribute
1415
$dom = DOM\HTMLDocument::createFromFile(__DIR__ . '/gb18030_without_charset.html', overrideEncoding: 'GB18030');
1516
var_dump($dom->documentElement->lastChild->textContent);
1617
var_dump($dom->encoding);
1718

19+
// The override encoding mismatches with the document encoding attribute
1820
$dom = DOM\HTMLDocument::createFromFile(__DIR__ . '/fallback_encoding.html', overrideEncoding: 'Windows-1252');
1921
var_dump($dom->documentElement->lastChild->textContent);
2022
var_dump($dom->encoding);

ext/dom/tests/modern/html/encoding/HTMLDocument_createFromString_override_encoding.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ try {
1111
echo $e->getMessage(), "\n";
1212
}
1313

14+
// The override encoding matches with the document encoding attribute
1415
$dom = DOM\HTMLDocument::createFromString(file_get_contents(__DIR__ . '/gb18030_without_charset.html'), overrideEncoding: 'GB18030');
1516
var_dump($dom->documentElement->lastChild->textContent);
1617
var_dump($dom->encoding);
1718

19+
// The override encoding mismatches with the document encoding attribute
1820
$dom = DOM\HTMLDocument::createFromString(file_get_contents(__DIR__ . '/fallback_encoding.html'), overrideEncoding: 'Windows-1252');
1921
var_dump($dom->documentElement->lastChild->textContent);
2022
var_dump($dom->encoding);

ext/dom/tests/modern/html/serializer/HTMLDocument_serialize_doctype.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ HTML, LIBXML_NOERROR);
1818
echo "--- XML encoding ---\n";
1919
echo $dom->saveXML();
2020
echo "--- HTML encoding ---\n";
21-
// We don't expec to see the public ID and the system ID because the serialization algorithm doesn't serialize those
21+
// We don't expect to see the public ID and the system ID because the serialization algorithm doesn't serialize those
2222
echo $dom->saveHTML();
2323

2424
?>

ext/dom/tests/modern/xml/XMLDocument_createFromFile_override_encoding.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ try {
1111
echo $e->getMessage(), "\n";
1212
}
1313

14+
// The override encoding matches with the document encoding attribute
1415
$dom = DOM\XMLDocument::createFromFile(__DIR__ . '/dummy.xml', overrideEncoding: 'UTF-8');
1516
var_dump($dom->documentElement->lastChild->textContent);
1617
var_dump($dom->encoding);
1718

19+
// The override encoding mismatches with the document encoding attribute
1820
$dom = DOM\XMLDocument::createFromFile(__DIR__ . '/dummy.xml', overrideEncoding: 'Windows-1252');
1921
var_dump($dom->documentElement->lastChild->textContent);
2022
var_dump($dom->encoding);

ext/dom/tests/modern/xml/XMLDocument_createFromString_override_encoding.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ try {
1111
echo $e->getMessage(), "\n";
1212
}
1313

14+
// The override encoding matches with the document encoding attribute
1415
$dom = DOM\XMLDocument::createFromString(file_get_contents(__DIR__ . '/dummy.xml'), overrideEncoding: 'UTF-8');
1516
var_dump($dom->documentElement->lastChild->textContent);
1617
var_dump($dom->encoding);
1718

19+
// The override encoding mismatches with the document encoding attribute
1820
$dom = DOM\XMLDocument::createFromString(file_get_contents(__DIR__ . '/dummy.xml'), overrideEncoding: 'Windows-1252');
1921
var_dump($dom->documentElement->lastChild->textContent);
2022
var_dump($dom->encoding);

ext/dom/tests/modern/xml/XMLDocument_fromString_03.phpt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,23 @@ try {
1616
}
1717

1818
foreach ($flags as $flag) {
19-
DOM\XMLDocument::createFromString('<?xml version="1.0"?><container/>', $flag);
19+
var_dump(DOM\XMLDocument::createFromString('<?xml version="1.0"?><container/>', $flag) instanceof DOM\XMLDocument);
2020
}
2121

2222
?>
2323
--EXPECT--
24-
DOM\XMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOENT, LIBXML_DTDLOAD, LIBXML_DTDATTR, LIBXML_DTDVALID, LIBXML_NOERROR, LIBXML_NOWARNING, LIBXML_NOBLANKS, LIBXML_XINCLUDE, LIBXML_NSCLEAN, LIBXML_NOCDATA, LIBXML_NONET, LIBXML_PEDANTIC, LIBXML_COMPACT, LIBXML_PARSEHUGE, LIBXML_BIGLINES)
24+
DOM\XMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOENT, LIBXML_DTDLOAD, LIBXML_DTDATTR, LIBXML_DTDVALID, LIBXML_NOERROR, LIBXML_NOWARNING, LIBXML_NOBLANKS, LIBXML_XINCLUDE, LIBXML_NSCLEAN, LIBXML_NOCDATA, LIBXML_NONET, LIBXML_PEDANTIC, LIBXML_COMPACT, LIBXML_PARSEHUGE, LIBXML_BIGLINES)bool(true)
25+
bool(true)
26+
bool(true)
27+
bool(true)
28+
bool(true)
29+
bool(true)
30+
bool(true)
31+
bool(true)
32+
bool(true)
33+
bool(true)
34+
bool(true)
35+
bool(true)
36+
bool(true)
37+
bool(true)
38+
bool(true)

0 commit comments

Comments
 (0)