Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DomCrawler] Improve html5Parser tests #49669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2023
Merged

[DomCrawler] Improve html5Parser tests #49669

merged 1 commit into from
Mar 13, 2023

Conversation

victor-prdh
Copy link
Contributor

@victor-prdh victor-prdh commented Mar 10, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? no
Deprecations? no
Tickets /
License MIT
Doc PR /

Hi !
As mentioned by @Bilge in #49121 (comment), test to ensure the new html5Parser strategy wasn't the best ! So i worked a little on this subject and i come with this new proposal !

Thanks

Comment on lines 60 to 61
$this->assertNotEquals($nativeCrawler->filterXPath('//h1')->text(), $html5Crawler->filterXPath('//h1')->text(), 'Native parser and Html5 parser must be different');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this prior test (testHtml5ParserNotSameAsNativeParserForSpecificHtml) be removed now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that's not a perfect test but it still validating a certain behaviour of the domCrawler component and can be interesting to keep ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this test case is useful to me, it tests the behavior and that's what we need also.
If the behavior of the xml parser changes, we'll know also, and this is good.

@nicolas-grekas
Copy link
Member

Thank you @victor-prdh.

@nicolas-grekas nicolas-grekas merged commit da9e54a into symfony:6.3 Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants