Skip to content

Commit 3949cc5

Browse files
committed
Improve some complex selector match tests
1 parent 7bccf3e commit 3949cc5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/phpunit/tests/html-api/wpHtmlProcessor-select.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,18 @@ public function test_select_all( string $html, string $selector, int $match_coun
4343
/**
4444
* Data provider.
4545
*
46-
* Most selectors are covered by the tag processor selector tests.
47-
* This suite should focus on complex selectors.
48-
*
4946
* @return array
5047
*/
5148
public static function data_selectors(): array {
5249
return array(
53-
'any descendant' => array( '<section><p match><i match><em match><p match>', 'section *', 4 ),
54-
'any child 1' => array( '<section><p match><i><em><p match>', 'section > *', 2 ),
55-
'any child 2' => array( '<div><section match><div>', 'div > *', 1 ),
50+
'any' => array( '<html match><head match><meta match><body match><p match>', '*', 5 ),
51+
'quirks mode ID' => array( '<p id="id" match><p id="ID" match>In quirks mode, ID matching is case-insensitive.', '#id', 2 ),
52+
'quirks mode class' => array( '<p class="c" match><p class="C" match>In quirks mode, class matching is case-insensitive.', '.c', 2 ),
53+
'no-quirks mode ID' => array( '<!DOCTYPE html><p id="id" match><p id="ID" match>In no-quirks mode, ID matching is case-sensitive.', '#id', 1 ),
54+
'no-quirks mode class' => array( '<!DOCTYPE html><p class="c" match><p class="C">In no-quirks mode, class matching is case-sensitive.', '.c', 1 ),
55+
'any descendant' => array( '<section><p match><i match><em match><p match>', 'section *', 4 ),
56+
'any child 1' => array( '<section><p match><i><em><p match>', 'section > *', 2 ),
57+
'any child 2' => array( '<div><section match><div>', 'div > *', 1 ),
5658
);
5759
}
5860

0 commit comments

Comments
 (0)