Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  Migrate to `static` data providers using `rector/rector`
  • Loading branch information
nicolas-grekas committed Feb 14, 2023
2 parents 7cb4a07 + 95f3c74 commit aedf3cb
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Tests/CssSelectorConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testCssToXPathWithoutPrefix($css, $xpath)
$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'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Node/SpecificityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testPlusValue(Specificity $specificity, $value)
$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],
Expand All @@ -45,7 +45,7 @@ public function testCompareTo(Specificity $a, Specificity $b, $result)
$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],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Parser/Handler/AbstractHandlerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public function testDontHandleValue($value)
$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();

Expand Down
4 changes: 2 additions & 2 deletions Tests/Parser/Handler/CommentHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testHandleValue($value, Token $unusedArgument, $remainingContent
$this->assertRemainingContent($reader, $remainingContent);
}

public function getHandleValueTestData()
public static function getHandleValueTestData()
{
return [
// 2nd argument only exists for inherited method compatibility
Expand All @@ -39,7 +39,7 @@ public function getHandleValueTestData()
];
}

public function getDontHandleValueTestData()
public static function getDontHandleValueTestData()
{
return [
['>'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Parser/Handler/HashHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class HashHandlerTest extends AbstractHandlerTestCase
{
public function getHandleValueTestData()
public static function getHandleValueTestData()
{
return [
['#id', new Token(Token::TYPE_HASH, 'id', 0), ''],
Expand All @@ -29,7 +29,7 @@ public function getHandleValueTestData()
];
}

public function getDontHandleValueTestData()
public static function getDontHandleValueTestData()
{
return [
['id'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Parser/Handler/IdentifierHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class IdentifierHandlerTest extends AbstractHandlerTestCase
{
public function getHandleValueTestData()
public static function getHandleValueTestData()
{
return [
['foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''],
Expand All @@ -29,7 +29,7 @@ public function getHandleValueTestData()
];
}

public function getDontHandleValueTestData()
public static function getDontHandleValueTestData()
{
return [
['>'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Parser/Handler/NumberHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class NumberHandlerTest extends AbstractHandlerTestCase
{
public function getHandleValueTestData()
public static function getHandleValueTestData()
{
return [
['12', new Token(Token::TYPE_NUMBER, '12', 0), ''],
Expand All @@ -30,7 +30,7 @@ public function getHandleValueTestData()
];
}

public function getDontHandleValueTestData()
public static function getDontHandleValueTestData()
{
return [
['hello'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Parser/Handler/StringHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class StringHandlerTest extends AbstractHandlerTestCase
{
public function getHandleValueTestData()
public static function getHandleValueTestData()
{
return [
['"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''],
Expand All @@ -31,7 +31,7 @@ public function getHandleValueTestData()
];
}

public function getDontHandleValueTestData()
public static function getDontHandleValueTestData()
{
return [
['hello'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Parser/Handler/WhitespaceHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class WhitespaceHandlerTest extends AbstractHandlerTestCase
{
public function getHandleValueTestData()
public static function getHandleValueTestData()
{
return [
[' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''],
Expand All @@ -28,7 +28,7 @@ public function getHandleValueTestData()
];
}

public function getDontHandleValueTestData()
public static function getDontHandleValueTestData()
{
return [
['>'],
Expand Down
12 changes: 6 additions & 6 deletions Tests/Parser/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function testParseSeriesException($series)
Parser::parseSeries($function->getArguments());
}

public function getParserTestData()
public static function getParserTestData()
{
return [
['*', ['Element[*]']],
Expand Down Expand Up @@ -151,7 +151,7 @@ public function getParserTestData()
];
}

public function getParserExceptionTestData()
public static function getParserExceptionTestData()
{
return [
['attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()],
Expand Down Expand Up @@ -181,7 +181,7 @@ public function getParserExceptionTestData()
];
}

public function getPseudoElementsTestData()
public static function getPseudoElementsTestData()
{
return [
['foo', 'Element[foo]', ''],
Expand All @@ -203,7 +203,7 @@ public function getPseudoElementsTestData()
];
}

public function getSpecificityTestData()
public static function getSpecificityTestData()
{
return [
['*', 0],
Expand Down Expand Up @@ -231,7 +231,7 @@ public function getSpecificityTestData()
];
}

public function getParseSeriesTestData()
public static function getParseSeriesTestData()
{
return [
['1n+3', 1, 3],
Expand All @@ -253,7 +253,7 @@ public function getParseSeriesTestData()
];
}

public function getParseSeriesExceptionTestData()
public static function getParseSeriesExceptionTestData()
{
return [
['foo'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Shortcut/ClassParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testParse($source, $representation)
$this->assertEquals($representation, (string) $selector->getTree());
}

public function getParseTestData()
public static function getParseTestData()
{
return [
['.testclass', 'Class[Element[*].testclass]'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Shortcut/ElementParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testParse($source, $representation)
$this->assertEquals($representation, (string) $selector->getTree());
}

public function getParseTestData()
public static function getParseTestData()
{
return [
['*', 'Element[*]'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Shortcut/HashParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testParse($source, $representation)
$this->assertEquals($representation, (string) $selector->getTree());
}

public function getParseTestData()
public static function getParseTestData()
{
return [
['#testid', 'Hash[Element[*]#testid]'],
Expand Down
10 changes: 5 additions & 5 deletions Tests/XPath/TranslatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function testOnlyOfTypeFindsSingleChildrenOfGivenType()
$this->assertSame('A', $nodeList->item(0)->textContent);
}

public function getXpathLiteralTestData()
public static function getXpathLiteralTestData()
{
return [
['foo', "'foo'"],
Expand All @@ -175,7 +175,7 @@ public function getXpathLiteralTestData()
];
}

public function getCssToXPathTestData()
public static function getCssToXPathTestData()
{
return [
['*', '*'],
Expand Down Expand Up @@ -222,7 +222,7 @@ public function getCssToXPathTestData()
];
}

public function getXmlLangTestData()
public static function getXmlLangTestData()
{
return [
[':lang("EN")', ['first', 'second', 'third', 'fourth']],
Expand All @@ -237,7 +237,7 @@ public function getXmlLangTestData()
];
}

public function getHtmlIdsTestData()
public static function getHtmlIdsTestData()
{
return [
['div', ['outer-div', 'li-div', 'foobar-div']],
Expand Down Expand Up @@ -362,7 +362,7 @@ public function getHtmlIdsTestData()
];
}

public function getHtmlShakespearTestData()
public static function getHtmlShakespearTestData()
{
return [
['*', 246],
Expand Down

0 comments on commit aedf3cb

Please sign in to comment.