Skip to content

Commit e6cad90

Browse files
minor symfony#61347 [DomCrawler] [Tests] Adapt testAddHtmlContentWithErrors to be HTML5 compliant (renanrodrigo)
This PR was merged into the 6.4 branch. Discussion ---------- [DomCrawler] [Tests] Adapt testAddHtmlContentWithErrors to be HTML5 compliant | Q | A | ------------- | --- | Branch? |6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony#61346 | License | MIT - What it does and why it's needed The new libxml2 uses HTML5 by default, and the current snippet used to test invalid HTML is HTML5-valid. This commit changes the snippet to be invalid both for HTML4 and HTML5, so the test passes. - A simple example of how it works (include PHP, YAML, etc.) - Running the test suite using a `php` build compiled against `libxml2` < `2.14` should keep working - Running the test suite using a `php` build compiled against `libxml2` >= `2.14` should now work - If it modifies existing behavior, include a before/after comparison It does not. Commits ------- 3c0410b [Tests] Adapt testAddHtmlContentWithErrors to be HTML5 compliant
2 parents a29dd87 + 3c0410b commit e6cad90

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/DomCrawler/Tests/NativeParserCrawlerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ public function testAddHtmlContentWithErrors()
2929
<head>
3030
</head>
3131
<body>
32-
<nav><a href="#"><a href="#"></nav>
32+
<div><a href="#"></div>
33+
</body>
3334
</body>
3435
</html>
3536
EOF
3637
, 'UTF-8');
3738

3839
$errors = libxml_get_errors();
3940
$this->assertCount(1, $errors);
40-
$this->assertEquals("Tag nav invalid\n", $errors[0]->message);
41+
$this->assertEquals("Unexpected end tag : body\n", $errors[0]->message);
4142

4243
libxml_clear_errors();
4344
libxml_use_internal_errors($internalErrors);

0 commit comments

Comments
 (0)