Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Symfony
css-selector
Commits
aedf3cb0
Commit
aedf3cb0
authored
2 years ago
by
Nicolas Grekas
Browse files
Options
Download
Plain Diff
Merge branch '5.4' into 6.2
* 5.4: Migrate to `static` data providers using `rector/rector`
parents
7cb4a070
95f3c746
6.2
6.3
v6.2.7
No related merge requests found
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
Tests/CssSelectorConverterTest.php
+1
-1
Tests/CssSelectorConverterTest.php
Tests/Node/SpecificityTest.php
+2
-2
Tests/Node/SpecificityTest.php
Tests/Parser/Handler/AbstractHandlerTestCase.php
+2
-2
Tests/Parser/Handler/AbstractHandlerTestCase.php
Tests/Parser/Handler/CommentHandlerTest.php
+2
-2
Tests/Parser/Handler/CommentHandlerTest.php
Tests/Parser/Handler/HashHandlerTest.php
+2
-2
Tests/Parser/Handler/HashHandlerTest.php
Tests/Parser/Handler/IdentifierHandlerTest.php
+2
-2
Tests/Parser/Handler/IdentifierHandlerTest.php
Tests/Parser/Handler/NumberHandlerTest.php
+2
-2
Tests/Parser/Handler/NumberHandlerTest.php
Tests/Parser/Handler/StringHandlerTest.php
+2
-2
Tests/Parser/Handler/StringHandlerTest.php
Tests/Parser/Handler/WhitespaceHandlerTest.php
+2
-2
Tests/Parser/Handler/WhitespaceHandlerTest.php
Tests/Parser/ParserTest.php
+6
-6
Tests/Parser/ParserTest.php
Tests/Parser/Shortcut/ClassParserTest.php
+1
-1
Tests/Parser/Shortcut/ClassParserTest.php
Tests/Parser/Shortcut/ElementParserTest.php
+1
-1
Tests/Parser/Shortcut/ElementParserTest.php
Tests/Parser/Shortcut/HashParserTest.php
+1
-1
Tests/Parser/Shortcut/HashParserTest.php
Tests/XPath/TranslatorTest.php
+5
-5
Tests/XPath/TranslatorTest.php
with
31 additions
and
31 deletions
+31
-31
Tests/CssSelectorConverterTest.php
+
1
-
1
View file @
aedf3cb0
...
...
@@ -60,7 +60,7 @@ class CssSelectorConverterTest extends TestCase
$this
->
assertEquals
(
$xpath
,
$converter
->
toXPath
(
$css
,
''
),
'->parse() parses an input string and returns a node'
);
}
public
function
getCssToXPathWithoutPrefixTestData
()
public
static
function
getCssToXPathWithoutPrefixTestData
()
{
return
[
[
'h1'
,
'h1'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Node/SpecificityTest.php
+
2
-
2
View file @
aedf3cb0
...
...
@@ -28,7 +28,7 @@ class SpecificityTest extends TestCase
$this
->
assertEquals
(
$value
+
123
,
$specificity
->
plus
(
new
Specificity
(
1
,
2
,
3
))
->
getValue
());
}
public
function
getValueTestData
()
public
static
function
getValueTestData
()
{
return
[
[
new
Specificity
(
0
,
0
,
0
),
0
],
...
...
@@ -45,7 +45,7 @@ class SpecificityTest extends TestCase
$this
->
assertEquals
(
$result
,
$a
->
compareTo
(
$b
));
}
public
function
getCompareTestData
()
public
static
function
getCompareTestData
()
{
return
[
[
new
Specificity
(
0
,
0
,
0
),
new
Specificity
(
0
,
0
,
0
),
0
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Handler/AbstractHandlerTestCase.php
+
2
-
2
View file @
aedf3cb0
...
...
@@ -43,9 +43,9 @@ abstract class AbstractHandlerTestCase extends TestCase
$this
->
assertRemainingContent
(
$reader
,
$value
);
}
abstract
public
function
getHandleValueTestData
();
abstract
public
static
function
getHandleValueTestData
();
abstract
public
function
getDontHandleValueTestData
();
abstract
public
static
function
getDontHandleValueTestData
();
abstract
protected
function
generateHandler
();
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Handler/CommentHandlerTest.php
+
2
-
2
View file @
aedf3cb0
...
...
@@ -30,7 +30,7 @@ class CommentHandlerTest extends AbstractHandlerTestCase
$this
->
assertRemainingContent
(
$reader
,
$remainingContent
);
}
public
function
getHandleValueTestData
()
public
static
function
getHandleValueTestData
()
{
return
[
// 2nd argument only exists for inherited method compatibility
...
...
@@ -39,7 +39,7 @@ class CommentHandlerTest extends AbstractHandlerTestCase
];
}
public
function
getDontHandleValueTestData
()
public
static
function
getDontHandleValueTestData
()
{
return
[
[
'>'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Handler/HashHandlerTest.php
+
2
-
2
View file @
aedf3cb0
...
...
@@ -18,7 +18,7 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
class
HashHandlerTest
extends
AbstractHandlerTestCase
{
public
function
getHandleValueTestData
()
public
static
function
getHandleValueTestData
()
{
return
[
[
'#id'
,
new
Token
(
Token
::
TYPE_HASH
,
'id'
,
0
),
''
],
...
...
@@ -29,7 +29,7 @@ class HashHandlerTest extends AbstractHandlerTestCase
];
}
public
function
getDontHandleValueTestData
()
public
static
function
getDontHandleValueTestData
()
{
return
[
[
'id'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Handler/IdentifierHandlerTest.php
+
2
-
2
View file @
aedf3cb0
...
...
@@ -18,7 +18,7 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
class
IdentifierHandlerTest
extends
AbstractHandlerTestCase
{
public
function
getHandleValueTestData
()
public
static
function
getHandleValueTestData
()
{
return
[
[
'foo'
,
new
Token
(
Token
::
TYPE_IDENTIFIER
,
'foo'
,
0
),
''
],
...
...
@@ -29,7 +29,7 @@ class IdentifierHandlerTest extends AbstractHandlerTestCase
];
}
public
function
getDontHandleValueTestData
()
public
static
function
getDontHandleValueTestData
()
{
return
[
[
'>'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Handler/NumberHandlerTest.php
+
2
-
2
View file @
aedf3cb0
...
...
@@ -17,7 +17,7 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
class
NumberHandlerTest
extends
AbstractHandlerTestCase
{
public
function
getHandleValueTestData
()
public
static
function
getHandleValueTestData
()
{
return
[
[
'12'
,
new
Token
(
Token
::
TYPE_NUMBER
,
'12'
,
0
),
''
],
...
...
@@ -30,7 +30,7 @@ class NumberHandlerTest extends AbstractHandlerTestCase
];
}
public
function
getDontHandleValueTestData
()
public
static
function
getDontHandleValueTestData
()
{
return
[
[
'hello'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Handler/StringHandlerTest.php
+
2
-
2
View file @
aedf3cb0
...
...
@@ -18,7 +18,7 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
class
StringHandlerTest
extends
AbstractHandlerTestCase
{
public
function
getHandleValueTestData
()
public
static
function
getHandleValueTestData
()
{
return
[
[
'"hello"'
,
new
Token
(
Token
::
TYPE_STRING
,
'hello'
,
1
),
''
],
...
...
@@ -31,7 +31,7 @@ class StringHandlerTest extends AbstractHandlerTestCase
];
}
public
function
getDontHandleValueTestData
()
public
static
function
getDontHandleValueTestData
()
{
return
[
[
'hello'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Handler/WhitespaceHandlerTest.php
+
2
-
2
View file @
aedf3cb0
...
...
@@ -16,7 +16,7 @@ use Symfony\Component\CssSelector\Parser\Token;
class
WhitespaceHandlerTest
extends
AbstractHandlerTestCase
{
public
function
getHandleValueTestData
()
public
static
function
getHandleValueTestData
()
{
return
[
[
' '
,
new
Token
(
Token
::
TYPE_WHITESPACE
,
' '
,
0
),
''
],
...
...
@@ -28,7 +28,7 @@ class WhitespaceHandlerTest extends AbstractHandlerTestCase
];
}
public
function
getDontHandleValueTestData
()
public
static
function
getDontHandleValueTestData
()
{
return
[
[
'>'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/ParserTest.php
+
6
-
6
View file @
aedf3cb0
...
...
@@ -93,7 +93,7 @@ class ParserTest extends TestCase
Parser
::
parseSeries
(
$function
->
getArguments
());
}
public
function
getParserTestData
()
public
static
function
getParserTestData
()
{
return
[
[
'*'
,
[
'Element[*]'
]],
...
...
@@ -151,7 +151,7 @@ class ParserTest extends TestCase
];
}
public
function
getParserExceptionTestData
()
public
static
function
getParserExceptionTestData
()
{
return
[
[
'attributes(href)/html/body/a'
,
SyntaxErrorException
::
unexpectedToken
(
'selector'
,
new
Token
(
Token
::
TYPE_DELIMITER
,
'('
,
10
))
->
getMessage
()],
...
...
@@ -181,7 +181,7 @@ class ParserTest extends TestCase
];
}
public
function
getPseudoElementsTestData
()
public
static
function
getPseudoElementsTestData
()
{
return
[
[
'foo'
,
'Element[foo]'
,
''
],
...
...
@@ -203,7 +203,7 @@ class ParserTest extends TestCase
];
}
public
function
getSpecificityTestData
()
public
static
function
getSpecificityTestData
()
{
return
[
[
'*'
,
0
],
...
...
@@ -231,7 +231,7 @@ class ParserTest extends TestCase
];
}
public
function
getParseSeriesTestData
()
public
static
function
getParseSeriesTestData
()
{
return
[
[
'1n+3'
,
1
,
3
],
...
...
@@ -253,7 +253,7 @@ class ParserTest extends TestCase
];
}
public
function
getParseSeriesExceptionTestData
()
public
static
function
getParseSeriesExceptionTestData
()
{
return
[
[
'foo'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Shortcut/ClassParserTest.php
+
1
-
1
View file @
aedf3cb0
...
...
@@ -32,7 +32,7 @@ class ClassParserTest extends TestCase
$this
->
assertEquals
(
$representation
,
(
string
)
$selector
->
getTree
());
}
public
function
getParseTestData
()
public
static
function
getParseTestData
()
{
return
[
[
'.testclass'
,
'Class[Element[*].testclass]'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Shortcut/ElementParserTest.php
+
1
-
1
View file @
aedf3cb0
...
...
@@ -32,7 +32,7 @@ class ElementParserTest extends TestCase
$this
->
assertEquals
(
$representation
,
(
string
)
$selector
->
getTree
());
}
public
function
getParseTestData
()
public
static
function
getParseTestData
()
{
return
[
[
'*'
,
'Element[*]'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/Parser/Shortcut/HashParserTest.php
+
1
-
1
View file @
aedf3cb0
...
...
@@ -32,7 +32,7 @@ class HashParserTest extends TestCase
$this
->
assertEquals
(
$representation
,
(
string
)
$selector
->
getTree
());
}
public
function
getParseTestData
()
public
static
function
getParseTestData
()
{
return
[
[
'#testid'
,
'Hash[Element[*]#testid]'
],
...
...
This diff is collapsed.
Click to expand it.
Tests/XPath/TranslatorTest.php
+
5
-
5
View file @
aedf3cb0
...
...
@@ -165,7 +165,7 @@ HTML
$this
->
assertSame
(
'A'
,
$nodeList
->
item
(
0
)
->
textContent
);
}
public
function
getXpathLiteralTestData
()
public
static
function
getXpathLiteralTestData
()
{
return
[
[
'foo'
,
"'foo'"
],
...
...
@@ -175,7 +175,7 @@ HTML
];
}
public
function
getCssToXPathTestData
()
public
static
function
getCssToXPathTestData
()
{
return
[
[
'*'
,
'*'
],
...
...
@@ -222,7 +222,7 @@ HTML
];
}
public
function
getXmlLangTestData
()
public
static
function
getXmlLangTestData
()
{
return
[
[
':lang("EN")'
,
[
'first'
,
'second'
,
'third'
,
'fourth'
]],
...
...
@@ -237,7 +237,7 @@ HTML
];
}
public
function
getHtmlIdsTestData
()
public
static
function
getHtmlIdsTestData
()
{
return
[
[
'div'
,
[
'outer-div'
,
'li-div'
,
'foobar-div'
]],
...
...
@@ -362,7 +362,7 @@ HTML
];
}
public
function
getHtmlShakespearTestData
()
public
static
function
getHtmlShakespearTestData
()
{
return
[
[
'*'
,
246
],
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets