diff --git a/src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php b/src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php index ceba8e7c06e90..58c1db8d6c17d 100644 --- a/src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php @@ -60,6 +60,24 @@ public function testHtml5ParserNotSameAsNativeParserForSpecificHtml() $this->assertNotEquals($nativeCrawler->filterXPath('//h1')->text(), $html5Crawler->filterXPath('//h1')->text(), 'Native parser and Html5 parser must be different'); } + /** + * @testWith [true] + * [false] + */ + public function testHasHtml5Parser(bool $useHtml5Parser) + { + $crawler = $this->createCrawler(null, null, null, $useHtml5Parser); + + $r = new \ReflectionProperty($crawler::class, 'html5Parser'); + $html5Parser = $r->getValue($crawler); + + if ($useHtml5Parser) { + $this->assertInstanceOf(\Masterminds\HTML5::class, $html5Parser, 'Html5Parser must be a Masterminds\HTML5 instance'); + } else { + $this->assertNull($html5Parser, 'Html5Parser must be null'); + } + } + public static function validHtml5Provider(): iterable { $html = self::getDoctype().'

Foo

'; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy