Tired of fragile HTML tests that depend on exact attribute order? WordPress 6.9 introduced assertEqualHTML(), a new way to validate HTML by comparing it semantically. This method normalizes the markup, ensuring your tests are resilient to changes!
Read more: developer.wordpress.org/news/2…
A better way to test HTML in WordPress with assertEqualHTML()
PHPUnit tests for HTML output are fragile. Attribute order changes, a trailing semicolon, and suddenly tests fail — even though the browser renders the same thing. WordPress 6.9 adds assertEqualHTML() to WP_UnitTestCase.WordPress Developer Blog
