Based on my experience in testing HTML, I now follow these three basic rules:
1. Do not check the HTML result for the correct template. You modify the HTML output too often, and you end up wasting time saving your tests.
2. HTML.
HTML ( HTML, ), HTML . : , , - HTML. , № 1.
3. , HTML.
HTML, , , . , .
PHP HTML5. Validator.nu. PHPUnit .
, :
$validator=new HTML5Validate();
$result=$validator->Assert('<p>Hello World</p>');
print $validator->message;