@@ -335,20 +335,18 @@ public function data_provider_sample_documents(): array {
335
335
</body>
336
336
</html>
337
337
' ,
338
- 'open_tags ' => array ( 'HTML ' , 'HEAD ' , 'BODY ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , ' DIV ' , ' IMG ' ),
338
+ 'open_tags ' => array ( 'HTML ' , 'HEAD ' , 'BODY ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' ),
339
339
'xpath_breadcrumbs ' => array (
340
- '/HTML ' => array ( 'HTML ' ),
341
- '/HTML/HEAD ' => array ( 'HTML ' , 'HEAD ' ),
342
- '/HTML/BODY ' => array ( 'HTML ' , 'BODY ' ),
343
- '/HTML/BODY/DIV[@id= \'wpadminbar \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
344
- '/HTML/BODY/DIV[@id= \'wpadminbar \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
345
- '/HTML/BODY/DIV[@id= \'header \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
340
+ '/HTML ' => array ( 'HTML ' ),
341
+ '/HTML/HEAD ' => array ( 'HTML ' , 'HEAD ' ),
342
+ '/HTML/BODY ' => array ( 'HTML ' , 'BODY ' ),
343
+ '/HTML/BODY/DIV[@id= \'header \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
346
344
'/HTML/BODY/DIV[@id= \'header \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
347
- '/HTML/BODY/DIV[@id= \'primary \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
345
+ '/HTML/BODY/DIV[@id= \'primary \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
348
346
'/HTML/BODY/DIV[@id= \'primary \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
349
- '/HTML/BODY/DIV[@id= \'secondary \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
347
+ '/HTML/BODY/DIV[@id= \'secondary \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
350
348
'/HTML/BODY/DIV[@id= \'secondary \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
351
- '/HTML/BODY/DIV[@id= \'colophon \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
349
+ '/HTML/BODY/DIV[@id= \'colophon \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
352
350
'/HTML/BODY/DIV[@id= \'colophon \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
353
351
),
354
352
),
@@ -388,27 +386,25 @@ public function data_provider_sample_documents(): array {
388
386
</body>
389
387
</html>
390
388
' ,
391
- 'open_tags ' => array ( 'HTML ' , 'HEAD ' , 'BODY ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , ' DIV ' , ' IMG ' ),
389
+ 'open_tags ' => array ( 'HTML ' , 'HEAD ' , 'BODY ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' , 'DIV ' , 'IMG ' ),
392
390
'xpath_breadcrumbs ' => array (
393
- '/HTML ' => array ( 'HTML ' ),
394
- '/HTML/HEAD ' => array ( 'HTML ' , 'HEAD ' ),
395
- '/HTML/BODY ' => array ( 'HTML ' , 'BODY ' ),
396
- '/HTML/BODY/DIV[@id= \'wpadminbar \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
397
- '/HTML/BODY/DIV[@id= \'wpadminbar \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
398
- '/HTML/BODY/DIV[@role= \'banner \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
391
+ '/HTML ' => array ( 'HTML ' ),
392
+ '/HTML/HEAD ' => array ( 'HTML ' , 'HEAD ' ),
393
+ '/HTML/BODY ' => array ( 'HTML ' , 'BODY ' ),
394
+ '/HTML/BODY/DIV[@role= \'banner \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
399
395
'/HTML/BODY/DIV[@role= \'banner \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
400
396
'/HTML/BODY/DIV[@class= \'content-area main \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
401
397
'/HTML/BODY/DIV[@class= \'content-area main \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
402
398
'/HTML/BODY/DIV[@class= \'widget-area \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
403
399
'/HTML/BODY/DIV[@class= \'widget-area \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
404
400
'/HTML/BODY/DIV[@class= \'site-footer \'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
405
401
'/HTML/BODY/DIV[@class= \'site-footer \']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
406
- '/HTML/BODY/DIV[@class= \'\'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
402
+ '/HTML/BODY/DIV[@class= \'\'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
407
403
'/HTML/BODY/DIV[@class= \'\']/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
408
- '/HTML/BODY/DIV[@role= \'\'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
404
+ '/HTML/BODY/DIV[@role= \'\'] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
409
405
'/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 ' ),
406
+ '/HTML/BODY/DIV ' => array ( 'HTML ' , 'BODY ' , 'DIV ' ),
407
+ '/HTML/BODY/DIV/*[1][self::IMG] ' => array ( 'HTML ' , 'BODY ' , 'DIV ' , 'IMG ' ),
412
408
),
413
409
),
414
410
);
@@ -442,7 +438,6 @@ public function test_next_tag_and_get_xpath( string $document, array $open_tags,
442
438
443
439
$ xpath = $ p ->get_stored_xpath ();
444
440
$ this ->assertArrayNotHasKey ( $ xpath , $ actual_xpath_breadcrumbs_mapping , 'Each tag must have a unique XPath. ' );
445
- $ this ->assertSame ( str_starts_with ( $ xpath , '/HTML/BODY/DIV[@id= \'wpadminbar \'] ' ), $ p ->is_admin_bar (), "Unexpected is_admin_bar for $ xpath " );
446
441
447
442
$ actual_xpath_breadcrumbs_mapping [ $ xpath ] = $ p ->get_breadcrumbs ();
448
443
0 commit comments