From 3c0410b556608ec3e9b23388cebefd08af4b9fe8 Mon Sep 17 00:00:00 2001 From: Renan Rodrigo Date: Tue, 5 Aug 2025 15:45:30 -0300 Subject: [PATCH] [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. --- .../Component/DomCrawler/Tests/NativeParserCrawlerTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DomCrawler/Tests/NativeParserCrawlerTest.php b/src/Symfony/Component/DomCrawler/Tests/NativeParserCrawlerTest.php index c61d9354b0371..6bd13d3145ca4 100644 --- a/src/Symfony/Component/DomCrawler/Tests/NativeParserCrawlerTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/NativeParserCrawlerTest.php @@ -29,7 +29,8 @@ public function testAddHtmlContentWithErrors() - +
+ EOF @@ -37,7 +38,7 @@ public function testAddHtmlContentWithErrors() $errors = libxml_get_errors(); $this->assertCount(1, $errors); - $this->assertEquals("Tag nav invalid\n", $errors[0]->message); + $this->assertEquals("Unexpected end tag : body\n", $errors[0]->message); libxml_clear_errors(); libxml_use_internal_errors($internalErrors);