Skip to content

Commit 64659ca

Browse files
committed
Add test case BODY>DIV which lacks attributes
1 parent 385d3bf commit 64659ca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plugins/optimization-detective/tests/test-class-od-html-tag-processor.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,14 @@ public function data_provider_sample_documents(): array {
381381
<img src="about:blank">
382382
A missing role attribute.
383383
</div>
384+
<div>
385+
<img src="about:blank">
386+
No attribute on the DIV at all. This would be quite unusual.
387+
</div>
384388
</body>
385389
</html>
386390
',
387-
'open_tags' => array( 'HTML', 'HEAD', 'BODY', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG' ),
391+
'open_tags' => array( 'HTML', 'HEAD', 'BODY', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG', 'DIV', 'IMG' ),
388392
'xpath_breadcrumbs' => array(
389393
'/HTML' => array( 'HTML' ),
390394
'/HTML/HEAD' => array( 'HTML', 'HEAD' ),
@@ -403,6 +407,8 @@ public function data_provider_sample_documents(): array {
403407
'/HTML/BODY/DIV[@class=\'\']/*[1][self::IMG]' => array( 'HTML', 'BODY', 'DIV', 'IMG' ),
404408
'/HTML/BODY/DIV[@role=\'\']' => array( 'HTML', 'BODY', 'DIV' ),
405409
'/HTML/BODY/DIV[@role=\'\']/*[1][self::IMG]' => array( 'HTML', 'BODY', 'DIV', 'IMG' ),
410+
'/HTML/BODY/DIV' => array( 'HTML', 'BODY', 'DIV' ),
411+
'/HTML/BODY/DIV/*[1][self::IMG]' => array( 'HTML', 'BODY', 'DIV', 'IMG' ),
406412
),
407413
),
408414
);

0 commit comments

Comments
 (0)