public function TranslatorTest::getHtmlIdsTestData in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php \Symfony\Component\CssSelector\Tests\XPath\TranslatorTest::getHtmlIdsTestData()
File
- vendor/
symfony/ css-selector/ Tests/ XPath/ TranslatorTest.php, line 150
Class
Namespace
Symfony\Component\CssSelector\Tests\XPathCode
public function getHtmlIdsTestData() {
return array(
array(
'div',
array(
'outer-div',
'li-div',
'foobar-div',
),
),
array(
'DIV',
array(
'outer-div',
'li-div',
'foobar-div',
),
),
// case-insensitive in HTML
array(
'div div',
array(
'li-div',
),
),
array(
'div, div div',
array(
'outer-div',
'li-div',
'foobar-div',
),
),
array(
'a[name]',
array(
'name-anchor',
),
),
array(
'a[NAme]',
array(
'name-anchor',
),
),
// case-insensitive in HTML:
array(
'a[rel]',
array(
'tag-anchor',
'nofollow-anchor',
),
),
array(
'a[rel="tag"]',
array(
'tag-anchor',
),
),
array(
'a[href*="localhost"]',
array(
'tag-anchor',
),
),
array(
'a[href*=""]',
array(),
),
array(
'a[href^="http"]',
array(
'tag-anchor',
'nofollow-anchor',
),
),
array(
'a[href^="http:"]',
array(
'tag-anchor',
),
),
array(
'a[href^=""]',
array(),
),
array(
'a[href$="org"]',
array(
'nofollow-anchor',
),
),
array(
'a[href$=""]',
array(),
),
array(
'div[foobar~="bc"]',
array(
'foobar-div',
),
),
array(
'div[foobar~="cde"]',
array(
'foobar-div',
),
),
array(
'[foobar~="ab bc"]',
array(
'foobar-div',
),
),
array(
'[foobar~=""]',
array(),
),
array(
'[foobar~=" \\t"]',
array(),
),
array(
'div[foobar~="cd"]',
array(),
),
array(
'*[lang|="En"]',
array(
'second-li',
),
),
array(
'[lang|="En-us"]',
array(
'second-li',
),
),
// Attribute values are case sensitive
array(
'*[lang|="en"]',
array(),
),
array(
'[lang|="en-US"]',
array(),
),
array(
'*[lang|="e"]',
array(),
),
// ... :lang() is not.
array(
':lang("EN")',
array(
'second-li',
'li-div',
),
),
array(
'*:lang(en-US)',
array(
'second-li',
'li-div',
),
),
array(
':lang("e")',
array(),
),
array(
'li:nth-child(3)',
array(
'third-li',
),
),
array(
'li:nth-child(10)',
array(),
),
array(
'li:nth-child(2n)',
array(
'second-li',
'fourth-li',
'sixth-li',
),
),
array(
'li:nth-child(even)',
array(
'second-li',
'fourth-li',
'sixth-li',
),
),
array(
'li:nth-child(2n+0)',
array(
'second-li',
'fourth-li',
'sixth-li',
),
),
array(
'li:nth-child(+2n+1)',
array(
'first-li',
'third-li',
'fifth-li',
'seventh-li',
),
),
array(
'li:nth-child(odd)',
array(
'first-li',
'third-li',
'fifth-li',
'seventh-li',
),
),
array(
'li:nth-child(2n+4)',
array(
'fourth-li',
'sixth-li',
),
),
array(
'li:nth-child(3n+1)',
array(
'first-li',
'fourth-li',
'seventh-li',
),
),
array(
'li:nth-child(n)',
array(
'first-li',
'second-li',
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'li:nth-child(n-1)',
array(
'first-li',
'second-li',
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'li:nth-child(n+1)',
array(
'first-li',
'second-li',
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'li:nth-child(n+3)',
array(
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'li:nth-child(-n)',
array(),
),
array(
'li:nth-child(-n-1)',
array(),
),
array(
'li:nth-child(-n+1)',
array(
'first-li',
),
),
array(
'li:nth-child(-n+3)',
array(
'first-li',
'second-li',
'third-li',
),
),
array(
'li:nth-last-child(0)',
array(),
),
array(
'li:nth-last-child(2n)',
array(
'second-li',
'fourth-li',
'sixth-li',
),
),
array(
'li:nth-last-child(even)',
array(
'second-li',
'fourth-li',
'sixth-li',
),
),
array(
'li:nth-last-child(2n+2)',
array(
'second-li',
'fourth-li',
'sixth-li',
),
),
array(
'li:nth-last-child(n)',
array(
'first-li',
'second-li',
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'li:nth-last-child(n-1)',
array(
'first-li',
'second-li',
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'li:nth-last-child(n-3)',
array(
'first-li',
'second-li',
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'li:nth-last-child(n+1)',
array(
'first-li',
'second-li',
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'li:nth-last-child(n+3)',
array(
'first-li',
'second-li',
'third-li',
'fourth-li',
'fifth-li',
),
),
array(
'li:nth-last-child(-n)',
array(),
),
array(
'li:nth-last-child(-n-1)',
array(),
),
array(
'li:nth-last-child(-n+1)',
array(
'seventh-li',
),
),
array(
'li:nth-last-child(-n+3)',
array(
'fifth-li',
'sixth-li',
'seventh-li',
),
),
array(
'ol:first-of-type',
array(
'first-ol',
),
),
array(
'ol:nth-child(1)',
array(
'first-ol',
),
),
array(
'ol:nth-of-type(2)',
array(
'second-ol',
),
),
array(
'ol:nth-last-of-type(1)',
array(
'second-ol',
),
),
array(
'span:only-child',
array(
'foobar-span',
),
),
array(
'li div:only-child',
array(
'li-div',
),
),
array(
'div *:only-child',
array(
'li-div',
'foobar-span',
),
),
array(
'p:only-of-type',
array(
'paragraph',
),
),
array(
'a:empty',
array(
'name-anchor',
),
),
array(
'a:EMpty',
array(
'name-anchor',
),
),
array(
'li:empty',
array(
'third-li',
'fourth-li',
'fifth-li',
'sixth-li',
),
),
array(
':root',
array(
'html',
),
),
array(
'html:root',
array(
'html',
),
),
array(
'li:root',
array(),
),
array(
'* :root',
array(),
),
array(
'*:contains("link")',
array(
'html',
'outer-div',
'tag-anchor',
'nofollow-anchor',
),
),
array(
':CONtains("link")',
array(
'html',
'outer-div',
'tag-anchor',
'nofollow-anchor',
),
),
array(
'*:contains("LInk")',
array(),
),
// case sensitive
array(
'*:contains("e")',
array(
'html',
'nil',
'outer-div',
'first-ol',
'first-li',
'paragraph',
'p-em',
),
),
array(
'*:contains("E")',
array(),
),
// case-sensitive
array(
'.a',
array(
'first-ol',
),
),
array(
'.b',
array(
'first-ol',
),
),
array(
'*.a',
array(
'first-ol',
),
),
array(
'ol.a',
array(
'first-ol',
),
),
array(
'.c',
array(
'first-ol',
'third-li',
'fourth-li',
),
),
array(
'*.c',
array(
'first-ol',
'third-li',
'fourth-li',
),
),
array(
'ol *.c',
array(
'third-li',
'fourth-li',
),
),
array(
'ol li.c',
array(
'third-li',
'fourth-li',
),
),
array(
'li ~ li.c',
array(
'third-li',
'fourth-li',
),
),
array(
'ol > li.c',
array(
'third-li',
'fourth-li',
),
),
array(
'#first-li',
array(
'first-li',
),
),
array(
'li#first-li',
array(
'first-li',
),
),
array(
'*#first-li',
array(
'first-li',
),
),
array(
'li div',
array(
'li-div',
),
),
array(
'li > div',
array(
'li-div',
),
),
array(
'div div',
array(
'li-div',
),
),
array(
'div > div',
array(),
),
array(
'div>.c',
array(
'first-ol',
),
),
array(
'div > .c',
array(
'first-ol',
),
),
array(
'div + div',
array(
'foobar-div',
),
),
array(
'a ~ a',
array(
'tag-anchor',
'nofollow-anchor',
),
),
array(
'a[rel="tag"] ~ a',
array(
'nofollow-anchor',
),
),
array(
'ol#first-ol li:last-child',
array(
'seventh-li',
),
),
array(
'ol#first-ol *:last-child',
array(
'li-div',
'seventh-li',
),
),
array(
'#outer-div:first-child',
array(
'outer-div',
),
),
array(
'#outer-div :first-child',
array(
'name-anchor',
'first-li',
'li-div',
'p-b',
'checkbox-fieldset-disabled',
'area-href',
),
),
array(
'a[href]',
array(
'tag-anchor',
'nofollow-anchor',
),
),
array(
':not(*)',
array(),
),
array(
'a:not([href])',
array(
'name-anchor',
),
),
array(
'ol :Not(li[class])',
array(
'first-li',
'second-li',
'li-div',
'fifth-li',
'sixth-li',
'seventh-li',
),
),
// HTML-specific
array(
':link',
array(
'link-href',
'tag-anchor',
'nofollow-anchor',
'area-href',
),
),
array(
':visited',
array(),
),
array(
':enabled',
array(
'link-href',
'tag-anchor',
'nofollow-anchor',
'checkbox-unchecked',
'text-checked',
'checkbox-checked',
'area-href',
),
),
array(
':disabled',
array(
'checkbox-disabled',
'checkbox-disabled-checked',
'fieldset',
'checkbox-fieldset-disabled',
),
),
array(
':checked',
array(
'checkbox-checked',
'checkbox-disabled-checked',
),
),
);
}