@@ -114,7 +114,7 @@ public function testHtmlIds($css, array $elementsId)
114
114
$ document ->loadHTMLFile (__DIR__ .'/Fixtures/ids.html ' );
115
115
$ document = simplexml_import_dom ($ document );
116
116
$ elements = $ document ->xpath ($ translator ->cssToXPath ($ css ));
117
- $ this ->assertCount (\count ($ elementsId ), $ elementsId );
117
+ $ this ->assertCount (\count ($ elementsId ), $ elements );
118
118
foreach ($ elements as $ element ) {
119
119
if (null !== $ element ->attributes ()->id ) {
120
120
$ this ->assertContains ((string ) $ element ->attributes ()->id , $ elementsId );
@@ -302,14 +302,14 @@ public static function getHtmlIdsTestData()
302
302
['li:nth-last-child(-n+1) ' , ['seventh-li ' ]],
303
303
['li:nth-last-child(-n+3) ' , ['fifth-li ' , 'sixth-li ' , 'seventh-li ' ]],
304
304
['ol:first-of-type ' , ['first-ol ' ]],
305
- ['ol:nth-child(1 ) ' , ['first-ol ' ]],
305
+ ['ol:nth-child(4 ) ' , ['first-ol ' ]],
306
306
['ol:nth-of-type(2) ' , ['second-ol ' ]],
307
307
['ol:nth-last-of-type(1) ' , ['second-ol ' ]],
308
- ['span:only-child ' , ['foobar-span ' ]],
308
+ ['span:only-child ' , ['foobar-span ' , ' no-siblings-of-any-type ' ]],
309
309
['li div:only-child ' , ['li-div ' ]],
310
310
['div *:only-child ' , ['li-div ' , 'foobar-span ' ]],
311
311
['p:only-of-type ' , ['paragraph ' ]],
312
- [':only-of-type ' , ['html ' , 'li-div ' , 'foobar-span ' , 'paragraph ' ]],
312
+ [':only-of-type ' , ['html ' , 'li-div ' , 'foobar-span ' , 'no-siblings-of-any-type ' ]],
313
313
['div#foobar-div :only-of-type ' , ['foobar-span ' ]],
314
314
['a:empty ' , ['name-anchor ' ]],
315
315
['a:EMpty ' , ['name-anchor ' ]],
@@ -318,8 +318,8 @@ public static function getHtmlIdsTestData()
318
318
['html:root ' , ['html ' ]],
319
319
['li:root ' , []],
320
320
['* :root ' , []],
321
- ['*:contains("link") ' , ['html ' , 'outer-div ' , 'tag-anchor ' , 'nofollow-anchor ' ]],
322
- [':CONtains("link") ' , ['html ' , 'outer-div ' , 'tag-anchor ' , 'nofollow-anchor ' ]],
321
+ ['*:contains("link") ' , ['html ' , 'nil ' , ' outer-div ' , 'tag-anchor ' , 'nofollow-anchor ' ]],
322
+ [':CONtains("link") ' , ['html ' , 'nil ' , ' outer-div ' , 'tag-anchor ' , 'nofollow-anchor ' ]],
323
323
['*:contains("LInk") ' , []], // case sensitive
324
324
['*:contains("e") ' , ['html ' , 'nil ' , 'outer-div ' , 'first-ol ' , 'first-li ' , 'paragraph ' , 'p-em ' ]],
325
325
['*:contains("E") ' , []], // case-sensitive
0 commit comments