Skip to content

Commit 3c0410b

Browse files
committed
[Tests] Adapt testAddHtmlContentWithErrors to be HTML5 compliant
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.
1 parent 9aa072c commit 3c0410b

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)