@@ -7,26 +7,26 @@ use Tester\DomQuery;
77
88require __DIR__ . '/../bootstrap.php ' ;
99
10- test (function () { // type selectors
10+ test (' type selectors ' , function () {
1111 Assert::same ('//* ' , DomQuery::css2xpath ('* ' ));
1212 Assert::same ('//foo ' , DomQuery::css2xpath ('foo ' ));
1313});
1414
1515
16- test (function () { // #ID
16+ test (' #ID ' , function () {
1717 Assert::same ("//*[@id='foo'] " , DomQuery::css2xpath ('#foo ' ));
1818 Assert::same ("//*[@id='id'] " , DomQuery::css2xpath ('*#id ' ));
1919});
2020
2121
22- test (function () { // class
22+ test (' class ' , function () {
2323 Assert::same ("//*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')] " , DomQuery::css2xpath ('.foo ' ));
2424 Assert::same ("//*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')] " , DomQuery::css2xpath ('*.foo ' ));
2525 Assert::same ("//*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')][contains(concat(' ', normalize-space(@class), ' '), ' bar ')] " , DomQuery::css2xpath ('.foo.bar ' ));
2626});
2727
2828
29- test (function () { // attribute selectors
29+ test (' attribute selectors ' , function () {
3030 Assert::same ('//div[@foo] ' , DomQuery::css2xpath ('div[foo] ' ));
3131 Assert::same ("//div[@foo='bar'] " , DomQuery::css2xpath ('div[foo=bar] ' ));
3232 Assert::same ("//*[@foo='bar'] " , DomQuery::css2xpath ('[foo="bar"] ' ));
@@ -42,14 +42,14 @@ test(function () { // attribute selectors
4242});
4343
4444
45- test (function () { // variants
45+ test (' variants ' , function () {
4646 Assert::same ("//*[@id='foo']|//*[@id='bar'] " , DomQuery::css2xpath ('#foo, #bar ' ));
4747 Assert::same ("//*[@id='foo']|//*[@id='bar'] " , DomQuery::css2xpath ('#foo,#bar ' ));
4848 Assert::same ("//*[@id='foo']|//*[@id='bar'] " , DomQuery::css2xpath ('#foo ,#bar ' ));
4949});
5050
5151
52- test (function () { // descendant combinator
52+ test (' descendant combinator ' , function () {
5353 Assert::same (
5454 "//div[@id='foo']//*[contains(concat(' ', normalize-space(@class), ' '), ' bar ')] " ,
5555 DomQuery::css2xpath ('div#foo .bar ' )
@@ -61,18 +61,18 @@ test(function () { // descendant combinator
6161});
6262
6363
64- test (function () { // child combinator
64+ test (' child combinator ' , function () {
6565 Assert::same ("//div[@id='foo']/span " , DomQuery::css2xpath ('div#foo>span ' ));
6666 Assert::same ("//div[@id='foo']/span " , DomQuery::css2xpath ('div#foo > span ' ));
6767});
6868
6969
70- test (function () { // general sibling combinator
70+ test (' general sibling combinator ' , function () {
7171 Assert::same ('//div/following-sibling::span ' , DomQuery::css2xpath ('div ~ span ' ));
7272});
7373
7474
75- test (function () { // complex
75+ test (' complex ' , function () {
7676 Assert::same (
7777 "//div[@id='foo']//span[contains(concat(' ', normalize-space(@class), ' '), ' bar ')] "
7878 . "|//*[@id='bar']//li[contains(concat(' ', normalize-space(@class), ' '), ' baz ')]//a " ,
@@ -81,14 +81,14 @@ test(function () { // complex
8181});
8282
8383
84- test (function () { // pseudoclass
84+ test (' pseudoclass ' , function () {
8585 Assert::exception (function () {
8686 DomQuery::css2xpath ('a:first-child ' );
8787 }, InvalidArgumentException::class);
8888});
8989
9090
91- test (function () { // adjacent sibling combinator
91+ test (' adjacent sibling combinator ' , function () {
9292 Assert::exception (function () {
9393 DomQuery::css2xpath ('div + span ' );
9494 }, InvalidArgumentException::class);
0 commit comments