Skip to content

Commit aedf3cb

Browse files
Merge branch '5.4' into 6.2
* 5.4: Migrate to `static` data providers using `rector/rector`
2 parents 7cb4a07 + 95f3c74 commit aedf3cb

14 files changed

+31
-31
lines changed

Diff for: Tests/CssSelectorConverterTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testCssToXPathWithoutPrefix($css, $xpath)
6060
$this->assertEquals($xpath, $converter->toXPath($css, ''), '->parse() parses an input string and returns a node');
6161
}
6262

63-
public function getCssToXPathWithoutPrefixTestData()
63+
public static function getCssToXPathWithoutPrefixTestData()
6464
{
6565
return [
6666
['h1', 'h1'],

Diff for: Tests/Node/SpecificityTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testPlusValue(Specificity $specificity, $value)
2828
$this->assertEquals($value + 123, $specificity->plus(new Specificity(1, 2, 3))->getValue());
2929
}
3030

31-
public function getValueTestData()
31+
public static function getValueTestData()
3232
{
3333
return [
3434
[new Specificity(0, 0, 0), 0],
@@ -45,7 +45,7 @@ public function testCompareTo(Specificity $a, Specificity $b, $result)
4545
$this->assertEquals($result, $a->compareTo($b));
4646
}
4747

48-
public function getCompareTestData()
48+
public static function getCompareTestData()
4949
{
5050
return [
5151
[new Specificity(0, 0, 0), new Specificity(0, 0, 0), 0],

Diff for: Tests/Parser/Handler/AbstractHandlerTestCase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public function testDontHandleValue($value)
4343
$this->assertRemainingContent($reader, $value);
4444
}
4545

46-
abstract public function getHandleValueTestData();
46+
abstract public static function getHandleValueTestData();
4747

48-
abstract public function getDontHandleValueTestData();
48+
abstract public static function getDontHandleValueTestData();
4949

5050
abstract protected function generateHandler();
5151

Diff for: Tests/Parser/Handler/CommentHandlerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testHandleValue($value, Token $unusedArgument, $remainingContent
3030
$this->assertRemainingContent($reader, $remainingContent);
3131
}
3232

33-
public function getHandleValueTestData()
33+
public static function getHandleValueTestData()
3434
{
3535
return [
3636
// 2nd argument only exists for inherited method compatibility
@@ -39,7 +39,7 @@ public function getHandleValueTestData()
3939
];
4040
}
4141

42-
public function getDontHandleValueTestData()
42+
public static function getDontHandleValueTestData()
4343
{
4444
return [
4545
['>'],

Diff for: Tests/Parser/Handler/HashHandlerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class HashHandlerTest extends AbstractHandlerTestCase
2020
{
21-
public function getHandleValueTestData()
21+
public static function getHandleValueTestData()
2222
{
2323
return [
2424
['#id', new Token(Token::TYPE_HASH, 'id', 0), ''],
@@ -29,7 +29,7 @@ public function getHandleValueTestData()
2929
];
3030
}
3131

32-
public function getDontHandleValueTestData()
32+
public static function getDontHandleValueTestData()
3333
{
3434
return [
3535
['id'],

Diff for: Tests/Parser/Handler/IdentifierHandlerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class IdentifierHandlerTest extends AbstractHandlerTestCase
2020
{
21-
public function getHandleValueTestData()
21+
public static function getHandleValueTestData()
2222
{
2323
return [
2424
['foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''],
@@ -29,7 +29,7 @@ public function getHandleValueTestData()
2929
];
3030
}
3131

32-
public function getDontHandleValueTestData()
32+
public static function getDontHandleValueTestData()
3333
{
3434
return [
3535
['>'],

Diff for: Tests/Parser/Handler/NumberHandlerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class NumberHandlerTest extends AbstractHandlerTestCase
1919
{
20-
public function getHandleValueTestData()
20+
public static function getHandleValueTestData()
2121
{
2222
return [
2323
['12', new Token(Token::TYPE_NUMBER, '12', 0), ''],
@@ -30,7 +30,7 @@ public function getHandleValueTestData()
3030
];
3131
}
3232

33-
public function getDontHandleValueTestData()
33+
public static function getDontHandleValueTestData()
3434
{
3535
return [
3636
['hello'],

Diff for: Tests/Parser/Handler/StringHandlerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class StringHandlerTest extends AbstractHandlerTestCase
2020
{
21-
public function getHandleValueTestData()
21+
public static function getHandleValueTestData()
2222
{
2323
return [
2424
['"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''],
@@ -31,7 +31,7 @@ public function getHandleValueTestData()
3131
];
3232
}
3333

34-
public function getDontHandleValueTestData()
34+
public static function getDontHandleValueTestData()
3535
{
3636
return [
3737
['hello'],

Diff for: Tests/Parser/Handler/WhitespaceHandlerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class WhitespaceHandlerTest extends AbstractHandlerTestCase
1818
{
19-
public function getHandleValueTestData()
19+
public static function getHandleValueTestData()
2020
{
2121
return [
2222
[' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''],
@@ -28,7 +28,7 @@ public function getHandleValueTestData()
2828
];
2929
}
3030

31-
public function getDontHandleValueTestData()
31+
public static function getDontHandleValueTestData()
3232
{
3333
return [
3434
['>'],

Diff for: Tests/Parser/ParserTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testParseSeriesException($series)
9393
Parser::parseSeries($function->getArguments());
9494
}
9595

96-
public function getParserTestData()
96+
public static function getParserTestData()
9797
{
9898
return [
9999
['*', ['Element[*]']],
@@ -151,7 +151,7 @@ public function getParserTestData()
151151
];
152152
}
153153

154-
public function getParserExceptionTestData()
154+
public static function getParserExceptionTestData()
155155
{
156156
return [
157157
['attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()],
@@ -181,7 +181,7 @@ public function getParserExceptionTestData()
181181
];
182182
}
183183

184-
public function getPseudoElementsTestData()
184+
public static function getPseudoElementsTestData()
185185
{
186186
return [
187187
['foo', 'Element[foo]', ''],
@@ -203,7 +203,7 @@ public function getPseudoElementsTestData()
203203
];
204204
}
205205

206-
public function getSpecificityTestData()
206+
public static function getSpecificityTestData()
207207
{
208208
return [
209209
['*', 0],
@@ -231,7 +231,7 @@ public function getSpecificityTestData()
231231
];
232232
}
233233

234-
public function getParseSeriesTestData()
234+
public static function getParseSeriesTestData()
235235
{
236236
return [
237237
['1n+3', 1, 3],
@@ -253,7 +253,7 @@ public function getParseSeriesTestData()
253253
];
254254
}
255255

256-
public function getParseSeriesExceptionTestData()
256+
public static function getParseSeriesExceptionTestData()
257257
{
258258
return [
259259
['foo'],

Diff for: Tests/Parser/Shortcut/ClassParserTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testParse($source, $representation)
3232
$this->assertEquals($representation, (string) $selector->getTree());
3333
}
3434

35-
public function getParseTestData()
35+
public static function getParseTestData()
3636
{
3737
return [
3838
['.testclass', 'Class[Element[*].testclass]'],

Diff for: Tests/Parser/Shortcut/ElementParserTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testParse($source, $representation)
3232
$this->assertEquals($representation, (string) $selector->getTree());
3333
}
3434

35-
public function getParseTestData()
35+
public static function getParseTestData()
3636
{
3737
return [
3838
['*', 'Element[*]'],

Diff for: Tests/Parser/Shortcut/HashParserTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testParse($source, $representation)
3232
$this->assertEquals($representation, (string) $selector->getTree());
3333
}
3434

35-
public function getParseTestData()
35+
public static function getParseTestData()
3636
{
3737
return [
3838
['#testid', 'Hash[Element[*]#testid]'],

Diff for: Tests/XPath/TranslatorTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function testOnlyOfTypeFindsSingleChildrenOfGivenType()
165165
$this->assertSame('A', $nodeList->item(0)->textContent);
166166
}
167167

168-
public function getXpathLiteralTestData()
168+
public static function getXpathLiteralTestData()
169169
{
170170
return [
171171
['foo', "'foo'"],
@@ -175,7 +175,7 @@ public function getXpathLiteralTestData()
175175
];
176176
}
177177

178-
public function getCssToXPathTestData()
178+
public static function getCssToXPathTestData()
179179
{
180180
return [
181181
['*', '*'],
@@ -222,7 +222,7 @@ public function getCssToXPathTestData()
222222
];
223223
}
224224

225-
public function getXmlLangTestData()
225+
public static function getXmlLangTestData()
226226
{
227227
return [
228228
[':lang("EN")', ['first', 'second', 'third', 'fourth']],
@@ -237,7 +237,7 @@ public function getXmlLangTestData()
237237
];
238238
}
239239

240-
public function getHtmlIdsTestData()
240+
public static function getHtmlIdsTestData()
241241
{
242242
return [
243243
['div', ['outer-div', 'li-div', 'foobar-div']],
@@ -362,7 +362,7 @@ public function getHtmlIdsTestData()
362362
];
363363
}
364364

365-
public function getHtmlShakespearTestData()
365+
public static function getHtmlShakespearTestData()
366366
{
367367
return [
368368
['*', 246],

0 commit comments

Comments
 (0)