From 162786d2ae2bcc2f47912fcb2d987834477b96b3 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 15:02:24 +0100 Subject: [PATCH 1/4] Update license years (last time) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 0083704..0138f8f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From e61859cff86f73a04fc82630b87c62bedb99fea1 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Sun, 5 Feb 2023 10:12:16 +0100 Subject: [PATCH 2/4] [Tests] Migrate data providers to static ones --- Tests/Node/AbstractNodeTest.php | 4 ++-- Tests/Node/AttributeNodeTest.php | 4 ++-- Tests/Node/ClassNodeTest.php | 4 ++-- Tests/Node/CombinedSelectorNodeTest.php | 4 ++-- Tests/Node/ElementNodeTest.php | 4 ++-- Tests/Node/FunctionNodeTest.php | 4 ++-- Tests/Node/HashNodeTest.php | 4 ++-- Tests/Node/NegationNodeTest.php | 4 ++-- Tests/Node/PseudoNodeTest.php | 4 ++-- Tests/Node/SelectorNodeTest.php | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Tests/Node/AbstractNodeTest.php b/Tests/Node/AbstractNodeTest.php index 5955513..85fe646 100644 --- a/Tests/Node/AbstractNodeTest.php +++ b/Tests/Node/AbstractNodeTest.php @@ -28,7 +28,7 @@ public function testSpecificityValue(NodeInterface $node, $value) $this->assertEquals($value, $node->getSpecificity()->getValue()); } - abstract public function getToStringConversionTestData(); + abstract public static function getToStringConversionTestData(); - abstract public function getSpecificityValueTestData(); + abstract public static function getSpecificityValueTestData(); } diff --git a/Tests/Node/AttributeNodeTest.php b/Tests/Node/AttributeNodeTest.php index 4d60074..fc17a84 100644 --- a/Tests/Node/AttributeNodeTest.php +++ b/Tests/Node/AttributeNodeTest.php @@ -16,7 +16,7 @@ class AttributeNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'], @@ -25,7 +25,7 @@ public function getToStringConversionTestData() ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10], diff --git a/Tests/Node/ClassNodeTest.php b/Tests/Node/ClassNodeTest.php index aa80c92..5a1b9d4 100644 --- a/Tests/Node/ClassNodeTest.php +++ b/Tests/Node/ClassNodeTest.php @@ -16,14 +16,14 @@ class ClassNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'], ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new ClassNode(new ElementNode(), 'class'), 10], diff --git a/Tests/Node/CombinedSelectorNodeTest.php b/Tests/Node/CombinedSelectorNodeTest.php index 435eaa6..c5c5116 100644 --- a/Tests/Node/CombinedSelectorNodeTest.php +++ b/Tests/Node/CombinedSelectorNodeTest.php @@ -16,7 +16,7 @@ class CombinedSelectorNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'], @@ -24,7 +24,7 @@ public function getToStringConversionTestData() ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0], diff --git a/Tests/Node/ElementNodeTest.php b/Tests/Node/ElementNodeTest.php index e0797ff..303dbcd 100644 --- a/Tests/Node/ElementNodeTest.php +++ b/Tests/Node/ElementNodeTest.php @@ -15,7 +15,7 @@ class ElementNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new ElementNode(), 'Element[*]'], @@ -24,7 +24,7 @@ public function getToStringConversionTestData() ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new ElementNode(), 0], diff --git a/Tests/Node/FunctionNodeTest.php b/Tests/Node/FunctionNodeTest.php index 0932393..58ff5fd 100644 --- a/Tests/Node/FunctionNodeTest.php +++ b/Tests/Node/FunctionNodeTest.php @@ -17,7 +17,7 @@ class FunctionNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'], @@ -31,7 +31,7 @@ public function getToStringConversionTestData() ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new FunctionNode(new ElementNode(), 'function'), 10], diff --git a/Tests/Node/HashNodeTest.php b/Tests/Node/HashNodeTest.php index ad6765b..479cca7 100644 --- a/Tests/Node/HashNodeTest.php +++ b/Tests/Node/HashNodeTest.php @@ -16,14 +16,14 @@ class HashNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'], ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new HashNode(new ElementNode(), 'id'), 100], diff --git a/Tests/Node/NegationNodeTest.php b/Tests/Node/NegationNodeTest.php index 90b684c..8c04ad9 100644 --- a/Tests/Node/NegationNodeTest.php +++ b/Tests/Node/NegationNodeTest.php @@ -17,14 +17,14 @@ class NegationNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'], ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10], diff --git a/Tests/Node/PseudoNodeTest.php b/Tests/Node/PseudoNodeTest.php index 4e78776..a5607ef 100644 --- a/Tests/Node/PseudoNodeTest.php +++ b/Tests/Node/PseudoNodeTest.php @@ -16,14 +16,14 @@ class PseudoNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'], ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new PseudoNode(new ElementNode(), 'pseudo'), 10], diff --git a/Tests/Node/SelectorNodeTest.php b/Tests/Node/SelectorNodeTest.php index 85e3bda..593aa27 100644 --- a/Tests/Node/SelectorNodeTest.php +++ b/Tests/Node/SelectorNodeTest.php @@ -16,7 +16,7 @@ class SelectorNodeTest extends AbstractNodeTest { - public function getToStringConversionTestData() + public static function getToStringConversionTestData() { return [ [new SelectorNode(new ElementNode()), 'Selector[Element[*]]'], @@ -24,7 +24,7 @@ public function getToStringConversionTestData() ]; } - public function getSpecificityValueTestData() + public static function getSpecificityValueTestData() { return [ [new SelectorNode(new ElementNode()), 0], From 66d6be30ae02ae6b881fa44ab2feb733309f3416 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 7 Feb 2023 10:31:13 +0100 Subject: [PATCH 3/4] minor #49253 [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/` (OskarStark) This PR was merged into the 6.3 branch. Discussion ---------- [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/` | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Refs https://github.com/symfony/symfony/pull/49233 | License | MIT | Doc PR | n/a Replaces #49234 Using `Test` suffix is deprecated since PHPUnit 10 Spotted in * https://github.com/symfony/symfony/pull/49233 Commits ------- cb3db968e4 [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/` --- Tests/Node/{AbstractNodeTest.php => AbstractNodeTestCase.php} | 2 +- Tests/Node/AttributeNodeTest.php | 2 +- Tests/Node/ClassNodeTest.php | 2 +- Tests/Node/CombinedSelectorNodeTest.php | 2 +- Tests/Node/ElementNodeTest.php | 2 +- Tests/Node/FunctionNodeTest.php | 2 +- Tests/Node/HashNodeTest.php | 2 +- Tests/Node/NegationNodeTest.php | 2 +- Tests/Node/PseudoNodeTest.php | 2 +- Tests/Node/SelectorNodeTest.php | 2 +- .../{AbstractHandlerTest.php => AbstractHandlerTestCase.php} | 2 +- Tests/Parser/Handler/CommentHandlerTest.php | 2 +- Tests/Parser/Handler/HashHandlerTest.php | 2 +- Tests/Parser/Handler/IdentifierHandlerTest.php | 2 +- Tests/Parser/Handler/NumberHandlerTest.php | 2 +- Tests/Parser/Handler/StringHandlerTest.php | 2 +- Tests/Parser/Handler/WhitespaceHandlerTest.php | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) rename Tests/Node/{AbstractNodeTest.php => AbstractNodeTestCase.php} (94%) rename Tests/Parser/Handler/{AbstractHandlerTest.php => AbstractHandlerTestCase.php} (97%) diff --git a/Tests/Node/AbstractNodeTest.php b/Tests/Node/AbstractNodeTestCase.php similarity index 94% rename from Tests/Node/AbstractNodeTest.php rename to Tests/Node/AbstractNodeTestCase.php index 85fe646..521e6d8 100644 --- a/Tests/Node/AbstractNodeTest.php +++ b/Tests/Node/AbstractNodeTestCase.php @@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\CssSelector\Node\NodeInterface; -abstract class AbstractNodeTest extends TestCase +abstract class AbstractNodeTestCase extends TestCase { /** @dataProvider getToStringConversionTestData */ public function testToStringConversion(NodeInterface $node, $representation) diff --git a/Tests/Node/AttributeNodeTest.php b/Tests/Node/AttributeNodeTest.php index fc17a84..62364c4 100644 --- a/Tests/Node/AttributeNodeTest.php +++ b/Tests/Node/AttributeNodeTest.php @@ -14,7 +14,7 @@ use Symfony\Component\CssSelector\Node\AttributeNode; use Symfony\Component\CssSelector\Node\ElementNode; -class AttributeNodeTest extends AbstractNodeTest +class AttributeNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Node/ClassNodeTest.php b/Tests/Node/ClassNodeTest.php index 5a1b9d4..3c0c67a 100644 --- a/Tests/Node/ClassNodeTest.php +++ b/Tests/Node/ClassNodeTest.php @@ -14,7 +14,7 @@ use Symfony\Component\CssSelector\Node\ClassNode; use Symfony\Component\CssSelector\Node\ElementNode; -class ClassNodeTest extends AbstractNodeTest +class ClassNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Node/CombinedSelectorNodeTest.php b/Tests/Node/CombinedSelectorNodeTest.php index c5c5116..bf9ed06 100644 --- a/Tests/Node/CombinedSelectorNodeTest.php +++ b/Tests/Node/CombinedSelectorNodeTest.php @@ -14,7 +14,7 @@ use Symfony\Component\CssSelector\Node\CombinedSelectorNode; use Symfony\Component\CssSelector\Node\ElementNode; -class CombinedSelectorNodeTest extends AbstractNodeTest +class CombinedSelectorNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Node/ElementNodeTest.php b/Tests/Node/ElementNodeTest.php index 303dbcd..e864eec 100644 --- a/Tests/Node/ElementNodeTest.php +++ b/Tests/Node/ElementNodeTest.php @@ -13,7 +13,7 @@ use Symfony\Component\CssSelector\Node\ElementNode; -class ElementNodeTest extends AbstractNodeTest +class ElementNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Node/FunctionNodeTest.php b/Tests/Node/FunctionNodeTest.php index 58ff5fd..b8d2e7a 100644 --- a/Tests/Node/FunctionNodeTest.php +++ b/Tests/Node/FunctionNodeTest.php @@ -15,7 +15,7 @@ use Symfony\Component\CssSelector\Node\FunctionNode; use Symfony\Component\CssSelector\Parser\Token; -class FunctionNodeTest extends AbstractNodeTest +class FunctionNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Node/HashNodeTest.php b/Tests/Node/HashNodeTest.php index 479cca7..a33cdd9 100644 --- a/Tests/Node/HashNodeTest.php +++ b/Tests/Node/HashNodeTest.php @@ -14,7 +14,7 @@ use Symfony\Component\CssSelector\Node\ElementNode; use Symfony\Component\CssSelector\Node\HashNode; -class HashNodeTest extends AbstractNodeTest +class HashNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Node/NegationNodeTest.php b/Tests/Node/NegationNodeTest.php index 8c04ad9..f90fa36 100644 --- a/Tests/Node/NegationNodeTest.php +++ b/Tests/Node/NegationNodeTest.php @@ -15,7 +15,7 @@ use Symfony\Component\CssSelector\Node\ElementNode; use Symfony\Component\CssSelector\Node\NegationNode; -class NegationNodeTest extends AbstractNodeTest +class NegationNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Node/PseudoNodeTest.php b/Tests/Node/PseudoNodeTest.php index a5607ef..f4c7404 100644 --- a/Tests/Node/PseudoNodeTest.php +++ b/Tests/Node/PseudoNodeTest.php @@ -14,7 +14,7 @@ use Symfony\Component\CssSelector\Node\ElementNode; use Symfony\Component\CssSelector\Node\PseudoNode; -class PseudoNodeTest extends AbstractNodeTest +class PseudoNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Node/SelectorNodeTest.php b/Tests/Node/SelectorNodeTest.php index 593aa27..3bf6666 100644 --- a/Tests/Node/SelectorNodeTest.php +++ b/Tests/Node/SelectorNodeTest.php @@ -14,7 +14,7 @@ use Symfony\Component\CssSelector\Node\ElementNode; use Symfony\Component\CssSelector\Node\SelectorNode; -class SelectorNodeTest extends AbstractNodeTest +class SelectorNodeTest extends AbstractNodeTestCase { public static function getToStringConversionTestData() { diff --git a/Tests/Parser/Handler/AbstractHandlerTest.php b/Tests/Parser/Handler/AbstractHandlerTestCase.php similarity index 97% rename from Tests/Parser/Handler/AbstractHandlerTest.php rename to Tests/Parser/Handler/AbstractHandlerTestCase.php index aaed55c..6bf810b 100644 --- a/Tests/Parser/Handler/AbstractHandlerTest.php +++ b/Tests/Parser/Handler/AbstractHandlerTestCase.php @@ -19,7 +19,7 @@ /** * @author Jean-François Simon */ -abstract class AbstractHandlerTest extends TestCase +abstract class AbstractHandlerTestCase extends TestCase { /** @dataProvider getHandleValueTestData */ public function testHandleValue($value, Token $expectedToken, $remainingContent) diff --git a/Tests/Parser/Handler/CommentHandlerTest.php b/Tests/Parser/Handler/CommentHandlerTest.php index de40047..59eaeba 100644 --- a/Tests/Parser/Handler/CommentHandlerTest.php +++ b/Tests/Parser/Handler/CommentHandlerTest.php @@ -16,7 +16,7 @@ use Symfony\Component\CssSelector\Parser\Token; use Symfony\Component\CssSelector\Parser\TokenStream; -class CommentHandlerTest extends AbstractHandlerTest +class CommentHandlerTest extends AbstractHandlerTestCase { /** @dataProvider getHandleValueTestData */ public function testHandleValue($value, Token $unusedArgument, $remainingContent) diff --git a/Tests/Parser/Handler/HashHandlerTest.php b/Tests/Parser/Handler/HashHandlerTest.php index 9444f51..a156305 100644 --- a/Tests/Parser/Handler/HashHandlerTest.php +++ b/Tests/Parser/Handler/HashHandlerTest.php @@ -16,7 +16,7 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -class HashHandlerTest extends AbstractHandlerTest +class HashHandlerTest extends AbstractHandlerTestCase { public function getHandleValueTestData() { diff --git a/Tests/Parser/Handler/IdentifierHandlerTest.php b/Tests/Parser/Handler/IdentifierHandlerTest.php index c54ba53..3bc35a9 100644 --- a/Tests/Parser/Handler/IdentifierHandlerTest.php +++ b/Tests/Parser/Handler/IdentifierHandlerTest.php @@ -16,7 +16,7 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -class IdentifierHandlerTest extends AbstractHandlerTest +class IdentifierHandlerTest extends AbstractHandlerTestCase { public function getHandleValueTestData() { diff --git a/Tests/Parser/Handler/NumberHandlerTest.php b/Tests/Parser/Handler/NumberHandlerTest.php index b43d369..07a6018 100644 --- a/Tests/Parser/Handler/NumberHandlerTest.php +++ b/Tests/Parser/Handler/NumberHandlerTest.php @@ -15,7 +15,7 @@ use Symfony\Component\CssSelector\Parser\Token; use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -class NumberHandlerTest extends AbstractHandlerTest +class NumberHandlerTest extends AbstractHandlerTestCase { public function getHandleValueTestData() { diff --git a/Tests/Parser/Handler/StringHandlerTest.php b/Tests/Parser/Handler/StringHandlerTest.php index baa7273..133ae38 100644 --- a/Tests/Parser/Handler/StringHandlerTest.php +++ b/Tests/Parser/Handler/StringHandlerTest.php @@ -16,7 +16,7 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -class StringHandlerTest extends AbstractHandlerTest +class StringHandlerTest extends AbstractHandlerTestCase { public function getHandleValueTestData() { diff --git a/Tests/Parser/Handler/WhitespaceHandlerTest.php b/Tests/Parser/Handler/WhitespaceHandlerTest.php index 67509ef..7a1b893 100644 --- a/Tests/Parser/Handler/WhitespaceHandlerTest.php +++ b/Tests/Parser/Handler/WhitespaceHandlerTest.php @@ -14,7 +14,7 @@ use Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler; use Symfony\Component\CssSelector\Parser\Token; -class WhitespaceHandlerTest extends AbstractHandlerTest +class WhitespaceHandlerTest extends AbstractHandlerTestCase { public function getHandleValueTestData() { From 95f3c7468db1da8cc360b24fa2a26e7cefcb355d Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 14 Dec 2022 15:42:16 +0100 Subject: [PATCH 4/4] Migrate to `static` data providers using `rector/rector` --- Tests/CssSelectorConverterTest.php | 2 +- Tests/Node/SpecificityTest.php | 4 ++-- Tests/Parser/Handler/AbstractHandlerTestCase.php | 4 ++-- Tests/Parser/Handler/CommentHandlerTest.php | 4 ++-- Tests/Parser/Handler/HashHandlerTest.php | 4 ++-- Tests/Parser/Handler/IdentifierHandlerTest.php | 4 ++-- Tests/Parser/Handler/NumberHandlerTest.php | 4 ++-- Tests/Parser/Handler/StringHandlerTest.php | 4 ++-- Tests/Parser/Handler/WhitespaceHandlerTest.php | 4 ++-- Tests/Parser/ParserTest.php | 12 ++++++------ Tests/Parser/Shortcut/ClassParserTest.php | 2 +- Tests/Parser/Shortcut/ElementParserTest.php | 2 +- Tests/Parser/Shortcut/HashParserTest.php | 2 +- Tests/XPath/TranslatorTest.php | 10 +++++----- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Tests/CssSelectorConverterTest.php b/Tests/CssSelectorConverterTest.php index 5fca693..36d39f3 100644 --- a/Tests/CssSelectorConverterTest.php +++ b/Tests/CssSelectorConverterTest.php @@ -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'], diff --git a/Tests/Node/SpecificityTest.php b/Tests/Node/SpecificityTest.php index bf48d49..8802e0c 100644 --- a/Tests/Node/SpecificityTest.php +++ b/Tests/Node/SpecificityTest.php @@ -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], @@ -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], diff --git a/Tests/Parser/Handler/AbstractHandlerTestCase.php b/Tests/Parser/Handler/AbstractHandlerTestCase.php index 6bf810b..69291e5 100644 --- a/Tests/Parser/Handler/AbstractHandlerTestCase.php +++ b/Tests/Parser/Handler/AbstractHandlerTestCase.php @@ -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(); diff --git a/Tests/Parser/Handler/CommentHandlerTest.php b/Tests/Parser/Handler/CommentHandlerTest.php index 59eaeba..c3be7f4 100644 --- a/Tests/Parser/Handler/CommentHandlerTest.php +++ b/Tests/Parser/Handler/CommentHandlerTest.php @@ -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 @@ -39,7 +39,7 @@ public function getHandleValueTestData() ]; } - public function getDontHandleValueTestData() + public static function getDontHandleValueTestData() { return [ ['>'], diff --git a/Tests/Parser/Handler/HashHandlerTest.php b/Tests/Parser/Handler/HashHandlerTest.php index a156305..c2ad031 100644 --- a/Tests/Parser/Handler/HashHandlerTest.php +++ b/Tests/Parser/Handler/HashHandlerTest.php @@ -18,7 +18,7 @@ class HashHandlerTest extends AbstractHandlerTestCase { - public function getHandleValueTestData() + public static function getHandleValueTestData() { return [ ['#id', new Token(Token::TYPE_HASH, 'id', 0), ''], @@ -29,7 +29,7 @@ public function getHandleValueTestData() ]; } - public function getDontHandleValueTestData() + public static function getDontHandleValueTestData() { return [ ['id'], diff --git a/Tests/Parser/Handler/IdentifierHandlerTest.php b/Tests/Parser/Handler/IdentifierHandlerTest.php index 3bc35a9..a39abb6 100644 --- a/Tests/Parser/Handler/IdentifierHandlerTest.php +++ b/Tests/Parser/Handler/IdentifierHandlerTest.php @@ -18,7 +18,7 @@ class IdentifierHandlerTest extends AbstractHandlerTestCase { - public function getHandleValueTestData() + public static function getHandleValueTestData() { return [ ['foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''], @@ -29,7 +29,7 @@ public function getHandleValueTestData() ]; } - public function getDontHandleValueTestData() + public static function getDontHandleValueTestData() { return [ ['>'], diff --git a/Tests/Parser/Handler/NumberHandlerTest.php b/Tests/Parser/Handler/NumberHandlerTest.php index 07a6018..7087a6b 100644 --- a/Tests/Parser/Handler/NumberHandlerTest.php +++ b/Tests/Parser/Handler/NumberHandlerTest.php @@ -17,7 +17,7 @@ class NumberHandlerTest extends AbstractHandlerTestCase { - public function getHandleValueTestData() + public static function getHandleValueTestData() { return [ ['12', new Token(Token::TYPE_NUMBER, '12', 0), ''], @@ -30,7 +30,7 @@ public function getHandleValueTestData() ]; } - public function getDontHandleValueTestData() + public static function getDontHandleValueTestData() { return [ ['hello'], diff --git a/Tests/Parser/Handler/StringHandlerTest.php b/Tests/Parser/Handler/StringHandlerTest.php index 133ae38..9a984ed 100644 --- a/Tests/Parser/Handler/StringHandlerTest.php +++ b/Tests/Parser/Handler/StringHandlerTest.php @@ -18,7 +18,7 @@ class StringHandlerTest extends AbstractHandlerTestCase { - public function getHandleValueTestData() + public static function getHandleValueTestData() { return [ ['"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''], @@ -31,7 +31,7 @@ public function getHandleValueTestData() ]; } - public function getDontHandleValueTestData() + public static function getDontHandleValueTestData() { return [ ['hello'], diff --git a/Tests/Parser/Handler/WhitespaceHandlerTest.php b/Tests/Parser/Handler/WhitespaceHandlerTest.php index 7a1b893..81dd761 100644 --- a/Tests/Parser/Handler/WhitespaceHandlerTest.php +++ b/Tests/Parser/Handler/WhitespaceHandlerTest.php @@ -16,7 +16,7 @@ class WhitespaceHandlerTest extends AbstractHandlerTestCase { - public function getHandleValueTestData() + public static function getHandleValueTestData() { return [ [' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''], @@ -28,7 +28,7 @@ public function getHandleValueTestData() ]; } - public function getDontHandleValueTestData() + public static function getDontHandleValueTestData() { return [ ['>'], diff --git a/Tests/Parser/ParserTest.php b/Tests/Parser/ParserTest.php index 77ce5d5..e36731b 100644 --- a/Tests/Parser/ParserTest.php +++ b/Tests/Parser/ParserTest.php @@ -93,7 +93,7 @@ public function testParseSeriesException($series) Parser::parseSeries($function->getArguments()); } - public function getParserTestData() + public static function getParserTestData() { return [ ['*', ['Element[*]']], @@ -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()], @@ -181,7 +181,7 @@ public function getParserExceptionTestData() ]; } - public function getPseudoElementsTestData() + public static function getPseudoElementsTestData() { return [ ['foo', 'Element[foo]', ''], @@ -203,7 +203,7 @@ public function getPseudoElementsTestData() ]; } - public function getSpecificityTestData() + public static function getSpecificityTestData() { return [ ['*', 0], @@ -231,7 +231,7 @@ public function getSpecificityTestData() ]; } - public function getParseSeriesTestData() + public static function getParseSeriesTestData() { return [ ['1n+3', 1, 3], @@ -253,7 +253,7 @@ public function getParseSeriesTestData() ]; } - public function getParseSeriesExceptionTestData() + public static function getParseSeriesExceptionTestData() { return [ ['foo'], diff --git a/Tests/Parser/Shortcut/ClassParserTest.php b/Tests/Parser/Shortcut/ClassParserTest.php index 29d9d5f..ded92ea 100644 --- a/Tests/Parser/Shortcut/ClassParserTest.php +++ b/Tests/Parser/Shortcut/ClassParserTest.php @@ -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]'], diff --git a/Tests/Parser/Shortcut/ElementParserTest.php b/Tests/Parser/Shortcut/ElementParserTest.php index 79cc227..4c10029 100644 --- a/Tests/Parser/Shortcut/ElementParserTest.php +++ b/Tests/Parser/Shortcut/ElementParserTest.php @@ -32,7 +32,7 @@ public function testParse($source, $representation) $this->assertEquals($representation, (string) $selector->getTree()); } - public function getParseTestData() + public static function getParseTestData() { return [ ['*', 'Element[*]'], diff --git a/Tests/Parser/Shortcut/HashParserTest.php b/Tests/Parser/Shortcut/HashParserTest.php index a7c79d6..c8bfdef 100644 --- a/Tests/Parser/Shortcut/HashParserTest.php +++ b/Tests/Parser/Shortcut/HashParserTest.php @@ -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]'], diff --git a/Tests/XPath/TranslatorTest.php b/Tests/XPath/TranslatorTest.php index 0a1ba4d..d330600 100644 --- a/Tests/XPath/TranslatorTest.php +++ b/Tests/XPath/TranslatorTest.php @@ -165,7 +165,7 @@ public function testOnlyOfTypeFindsSingleChildrenOfGivenType() $this->assertSame('A', $nodeList->item(0)->textContent); } - public function getXpathLiteralTestData() + public static function getXpathLiteralTestData() { return [ ['foo', "'foo'"], @@ -175,7 +175,7 @@ public function getXpathLiteralTestData() ]; } - public function getCssToXPathTestData() + public static function getCssToXPathTestData() { return [ ['*', '*'], @@ -222,7 +222,7 @@ public function getCssToXPathTestData() ]; } - public function getXmlLangTestData() + public static function getXmlLangTestData() { return [ [':lang("EN")', ['first', 'second', 'third', 'fourth']], @@ -237,7 +237,7 @@ public function getXmlLangTestData() ]; } - public function getHtmlIdsTestData() + public static function getHtmlIdsTestData() { return [ ['div', ['outer-div', 'li-div', 'foobar-div']], @@ -362,7 +362,7 @@ public function getHtmlIdsTestData() ]; } - public function getHtmlShakespearTestData() + public static function getHtmlShakespearTestData() { return [ ['*', 246],