Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit: how to test HTML structure output

I'm trying to test a HTML structure render.

I saw this method: https://phpunit.de/manual/3.7/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions.assertTag

...But on the last version, it's obsolete.

What is now the best practice for this kind of verification ?

Best regards.

like image 398
Noweh Avatar asked Feb 04 '26 22:02

Noweh


1 Answers

They were deprecated in 2014:

https://github.com/sebastianbergmann/phpunit/issues/1292

The new versions are in progress:

  • https://github.com/lstrojny/phpunit-dom-assertions
  • https://packagist.org/packages/phpunit/phpunit-dom-assertions
like image 89
JMP Avatar answered Feb 06 '26 12:02

JMP