From cb07f212fce9a782109b5aaca6282b01174486af Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Sat, 11 Feb 2023 13:49:38 +0100 Subject: [PATCH] Updated test suite for PHPUnit 10 --- .gitignore | 1 + README.md | 2 +- docs/testdox.txt | 30 ---------------- tests/BundleTest.php | 21 ++++++------ ...AbstractTest.php => AbstractTestClass.php} | 4 +-- tests/Bundles/FatdownTest.php | 2 +- tests/Bundles/ForumTest.php | 2 +- tests/Bundles/MediaPackTest.php | 2 +- tests/Configurator/BundleGeneratorTest.php | 6 ++-- .../Collections/NormalizedCollectionTest.php | 2 +- .../Collections/NormalizedListTest.php | 2 +- .../UnsafeTemplateExceptionTest.php | 2 +- tests/Configurator/Helpers/AVTHelperTest.php | 8 ++--- .../Helpers/ElementInspectorTest.php | 2 +- .../Configurator/Helpers/FilterHelperTest.php | 4 +-- .../Helpers/FilterSyntaxMatcherTest.php | 2 +- .../Configurator/Helpers/NodeLocatorTest.php | 8 ++--- .../Configurator/Helpers/RegexpParserTest.php | 4 +-- .../Helpers/TemplateHelperTest.php | 6 ++-- .../Helpers/TemplateInspectorTest.php | 2 +- .../Helpers/TemplateModifierTest.php | 2 +- .../Helpers/TemplateParserTest.php | 2 +- .../Configurator/Helpers/XPathHelperTest.php | 8 ++--- .../AttributeFilters/ChoiceFilterTest.php | 8 ++--- .../AttributeFilters/HashmapFilterTest.php | 2 +- .../Items/AttributeFilters/MapFilterTest.php | 2 +- .../AttributeFilters/RangeFilterTest.php | 2 +- .../AttributeFilters/RegexpFilterTest.php | 2 +- tests/Configurator/Items/TemplateTest.php | 6 ++-- .../JavaScript/CallbackGeneratorTest.php | 2 +- .../JavaScript/ConfigOptimizerTest.php | 2 +- tests/Configurator/JavaScript/EncoderTest.php | 2 +- .../JavaScript/FunctionCacheTest.php | 2 +- tests/Configurator/JavaScript/HasherTest.php | 2 +- .../Configurator/JavaScript/MinifierTest.php | 2 +- .../JavaScript/StylesheetCompressorTest.php | 2 +- tests/Configurator/JavaScriptTest.php | 2 +- tests/Configurator/RecursiveParserTest.php | 2 +- .../PHP/BranchOutputOptimizerTest.php | 2 +- .../PHP/ControlStructuresOptimizerTest.php | 2 +- .../RendererGenerators/PHP/OptimizerTest.php | 2 +- .../RendererGenerators/PHP/QuickTest.php | 6 ++-- .../RendererGenerators/PHP/SerializerTest.php | 2 +- .../PHP/SwitchStatementTest.php | 2 +- ...est.php => AbstractConvertorTestClass.php} | 4 +-- .../Convertors/BooleanFunctionsTest.php | 4 +-- .../Convertors/BooleanOperatorsTest.php | 4 +-- .../Convertors/ComparisonsTest.php | 4 +-- .../XPathConvertor/Convertors/CoreTest.php | 4 +-- .../XPathConvertor/Convertors/MathTest.php | 4 +-- .../MultiByteStringManipulationTest.php | 4 +-- .../Convertors/PHP80FunctionsTest.php | 4 +-- .../SingleByteStringFunctionsTest.php | 4 +-- .../SingleByteStringManipulationTest.php | 4 +-- .../PHP/XPathConvertorTest.php | 8 ++--- .../RendererGenerators/PHPTest.php | 24 ++++++------- tests/Configurator/RenderingTest.php | 2 +- tests/Configurator/RulesGeneratorTest.php | 2 +- ...AbstractTest.php => AbstractTestClass.php} | 2 +- .../RulesGenerators/AllowAllTest.php | 2 +- .../RulesGenerators/AutoCloseIfVoidTest.php | 2 +- .../AutoReopenFormattingElementsTest.php | 2 +- ...ockElementsCloseFormattingElementsTest.php | 2 +- ...ckElementsFosterFormattingElementsTest.php | 2 +- ...toLineBreaksIfNewLinesArePreservedTest.php | 2 +- .../EnforceContentModelsTest.php | 2 +- .../EnforceOptionalEndTagsTest.php | 2 +- .../RulesGenerators/IgnoreTagsInCodeTest.php | 2 +- .../IgnoreTextIfDisallowedTest.php | 2 +- ...gnoreWhitespaceAroundBlockElementsTest.php | 2 +- .../RulesGenerators/ManageParagraphsTest.php | 2 +- .../TrimFirstLineInCodeBlocksTest.php | 2 +- ... AbstractDynamicContentCheckTestClass.php} | 2 +- ...php => AbstractTemplateCheckTestClass.php} | 2 +- .../DisallowAttributeSetsTest.php | 2 +- .../TemplateChecks/DisallowCopyTest.php | 2 +- .../DisallowDisableOutputEscapingTest.php | 2 +- .../DisallowDynamicAttributeNamesTest.php | 2 +- .../DisallowDynamicElementNamesTest.php | 2 +- .../TemplateChecks/DisallowElementNSTest.php | 2 +- .../TemplateChecks/DisallowElementTest.php | 2 +- .../DisallowFlashFullScreenTest.php | 2 +- .../DisallowNodeByXPathTest.php | 2 +- ...allowObjectParamsWithGeneratedNameTest.php | 2 +- .../TemplateChecks/DisallowPHPTagsTest.php | 2 +- .../DisallowUncompilableXSLTest.php | 2 +- .../DisallowUnsafeCopyOfTest.php | 2 +- .../DisallowUnsafeDynamicCSSTest.php | 2 +- .../DisallowUnsafeDynamicJSTest.php | 2 +- .../DisallowUnsafeDynamicURLTest.php | 2 +- .../DisallowUnsupportedXSLTest.php | 2 +- .../DisallowXPathFunctionTest.php | 2 +- .../RestrictFlashNetworkingTest.php | 2 +- .../RestrictFlashScriptAccessTest.php | 2 +- ...php => AbstractNormalizationTestClass.php} | 4 +-- ...AbstractTest.php => AbstractTestClass.php} | 4 +-- .../AddAttributeValueToElementsTest.php | 4 +-- .../ConvertCurlyExpressionsInTextTest.php | 4 +-- .../TemplateNormalizations/CustomTest.php | 2 +- .../DeoptimizeIfTest.php | 4 +-- .../EnforceHTMLOmittedEndTagsTest.php | 4 +-- ...escapedCurlyBracesInHtmlAttributesTest.php | 4 +-- .../FoldArithmeticConstantsTest.php | 4 +-- .../FoldConstantXPathExpressionsTest.php | 4 +-- .../InlineAttributesTest.php | 4 +-- .../InlineCDATATest.php | 4 +-- .../InlineElementsTest.php | 4 +-- .../InlineInferredValuesTest.php | 4 +-- .../InlineTextElementsTest.php | 4 +-- .../InlineXPathLiteralsTest.php | 4 +-- .../MergeConsecutiveCopyOfTest.php | 4 +-- .../MergeIdenticalConditionalBranchesTest.php | 4 +-- .../MinifyInlineCSSTest.php | 4 +-- .../MinifyXPathExpressionsTest.php | 4 +-- .../NormalizeAttributeNamesTest.php | 4 +-- .../NormalizeElementNamesTest.php | 4 +-- .../NormalizeUrlsTest.php | 4 +-- .../OptimizeChooseDeadBranchesTest.php | 4 +-- .../OptimizeChooseTest.php | 4 +-- .../OptimizeChooseTextTest.php | 4 +-- .../OptimizeConditionalAttributesTest.php | 4 +-- .../OptimizeConditionalValueOfTest.php | 4 +-- .../OptimizeNestedConditionalsTest.php | 4 +-- .../PreserveSingleSpacesTest.php | 4 +-- .../RemoveCommentsTest.php | 4 +-- .../RemoveInterElementWhitespaceTest.php | 4 +-- .../RemoveLivePreviewAttributesTest.php | 4 +-- .../RenameLivePreviewEventTest.php | 4 +-- .../SetAttributeOnElementsTest.php | 4 +-- .../SetRelNoreferrerOnTargetedLinksTest.php | 4 +-- .../SortAttributesByNameTest.php | 4 +-- .../TransposeCommentsTest.php | 4 +-- .../UninlineAttributesTest.php | 4 +-- tests/Configurator/TemplateNormalizerTest.php | 4 +-- ...erTest.php => AbstractFilterTestClass.php} | 4 +-- .../AttributeFilters/AlnumFilterTest.php | 4 +-- .../AttributeFilters/ColorFilterTest.php | 4 +-- .../AttributeFilters/EmailFilterTest.php | 4 +-- .../AttributeFilters/FalseFilterTest.php | 4 +-- .../AttributeFilters/FontfamilyFilterTest.php | 4 +-- .../AttributeFilters/HashmapFilterTest.php | 4 +-- .../AttributeFilters/IdentifierFilterTest.php | 4 +-- .../Parser/AttributeFilters/MapFilterTest.php | 4 +-- .../AttributeFilters/NetworkFilterTest.php | 4 +-- .../AttributeFilters/NumericFilterTest.php | 6 ++-- .../AttributeFilters/RangeFilterTest.php | 4 +-- .../AttributeFilters/RegexpFilterTest.php | 4 +-- .../AttributeFilters/SimpletextFilterTest.php | 4 +-- .../AttributeFilters/TimestampFilterTest.php | 4 +-- .../Parser/AttributeFilters/UrlFilterTest.php | 6 ++-- tests/Parser/FilterProcessingTest.php | 34 +++++++++---------- tests/Parser/FunctionalTest.php | 2 +- tests/Parser/OutputHandlingTest.php | 2 +- tests/Parser/PluginsHandlingTest.php | 6 ++-- tests/Parser/RulesHandlingTest.php | 2 +- tests/Parser/TagProcessingTest.php | 20 +++++------ tests/Parser/TagTest.php | 6 ++-- tests/Plugins/Autoemail/ParserTest.php | 4 +-- tests/Plugins/Autoimage/ParserTest.php | 4 +-- tests/Plugins/Autolink/ParserTest.php | 4 +-- tests/Plugins/Autovideo/ParserTest.php | 4 +-- tests/Plugins/BBCodes/BBCodesTest.php | 4 +-- .../BBCodes/Configurator/BBCodeMonkeyTest.php | 2 +- tests/Plugins/BBCodes/ParserTest.php | 2 +- tests/Plugins/Censor/ParserTest.php | 4 +-- tests/Plugins/Emoji/ParserTest.php | 4 +-- tests/Plugins/Emoticons/ParserTest.php | 4 +-- tests/Plugins/Escaper/ParserTest.php | 4 +-- tests/Plugins/FancyPants/ParserTest.php | 4 +-- tests/Plugins/HTMLComments/ParserTest.php | 4 +-- tests/Plugins/HTMLElements/ParserTest.php | 4 +-- tests/Plugins/HTMLEntities/ParserTest.php | 4 +-- tests/Plugins/Keywords/ParserTest.php | 2 +- ...AbstractTest.php => AbstractTestClass.php} | 6 ++-- .../Litedown/Parser/Passes/BlocksTest.php | 6 ++-- .../Litedown/Parser/Passes/EmphasisTest.php | 6 ++-- .../Parser/Passes/ForcedLineBreaksTest.php | 6 ++-- .../Litedown/Parser/Passes/ImagesTest.php | 6 ++-- .../Litedown/Parser/Passes/InlineCodeTest.php | 6 ++-- .../Parser/Passes/InlineSpoilerTest.php | 6 ++-- .../Litedown/Parser/Passes/LinksTest.php | 6 ++-- .../Parser/Passes/StrikethroughTest.php | 6 ++-- .../Litedown/Parser/Passes/SubscriptTest.php | 6 ++-- .../Parser/Passes/SuperscriptTest.php | 6 ++-- tests/Plugins/Litedown/ParserTest.php | 2 +- ...AbstractTest.php => AbstractTestClass.php} | 4 +-- .../TemplateGenerators/ChooseTest.php | 4 +-- .../TemplateGenerators/FlashTest.php | 4 +-- .../TemplateGenerators/IframeTest.php | 4 +-- tests/Plugins/MediaEmbed/ParserTest.php | 14 ++++---- tests/Plugins/PipeTables/ParserTest.php | 4 +-- tests/Plugins/Preg/ParserTest.php | 4 +-- tests/Plugins/TaskLists/HelperTest.php | 4 +-- tests/Plugins/TaskLists/ParserTest.php | 4 +-- tests/Test.php | 21 ------------ ...AbstractTest.php => AbstractTestClass.php} | 2 +- tests/Utils/Http/Clients/CachedTest.php | 2 +- tests/Utils/Http/Clients/CurlTest.php | 2 +- tests/Utils/Http/Clients/NativeTest.php | 2 +- tests/UtilsTest.php | 10 +++--- 200 files changed, 391 insertions(+), 446 deletions(-) create mode 100644 .gitignore rename tests/Bundles/{AbstractTest.php => AbstractTestClass.php} (98%) rename tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/{AbstractConvertorTest.php => AbstractConvertorTestClass.php} (94%) rename tests/Configurator/RulesGenerators/{AbstractTest.php => AbstractTestClass.php} (95%) rename tests/Configurator/TemplateChecks/{AbstractDynamicContentCheckTest.php => AbstractDynamicContentCheckTestClass.php} (99%) rename tests/Configurator/TemplateChecks/{AbstractTemplateCheckTest.php => AbstractTemplateCheckTestClass.php} (86%) rename tests/Configurator/TemplateNormalizations/{AbstractNormalizationTest.php => AbstractNormalizationTestClass.php} (97%) rename tests/Configurator/TemplateNormalizations/{AbstractTest.php => AbstractTestClass.php} (92%) rename tests/Parser/AttributeFilters/{AbstractFilterTest.php => AbstractFilterTestClass.php} (94%) rename tests/Plugins/Litedown/Parser/Passes/{AbstractTest.php => AbstractTestClass.php} (85%) rename tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/{AbstractTest.php => AbstractTestClass.php} (85%) rename tests/Utils/Http/Clients/{AbstractTest.php => AbstractTestClass.php} (98%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..21d46d8ea7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.phpunit.cache \ No newline at end of file diff --git a/README.md b/README.md index df14934945..4b1d303c67 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,6 @@ You can try the JavaScript version in this [BBCodes + other stuff demo](https:// The following tools are used during development. - - [phpunit/phpunit](https://phpunit.de/) 9.6.3 runs a full suite of tests before every commit. + - [phpunit/phpunit](https://phpunit.de/) 10.0.7 runs a full suite of tests before every commit. - [code-lts/doctum](https://github.com/code-lts/doctum) 5.5.1 generates the [API docs](https://s9e.github.io/TextFormatter/api/). - Scrutinizer is used for code tracking. diff --git a/docs/testdox.txt b/docs/testdox.txt index 3970d4446e..c40ee30e5b 100644 --- a/docs/testdox.txt +++ b/docs/testdox.txt @@ -3092,25 +3092,6 @@ Template Checker (s9e\TextFormatter\Tests\Configurator\TemplateChecker) [x] disable() disables all checks [x] enable() re-enables all checks -Abstract Dynamic Content Check (s9e\TextFormatter\Tests\Configurator\TemplateChecks\AbstractDynamicContentCheck) - [x] Stylesheet parameters are considered safe - [x] Variables pointing to an unknown attribute are unsafe - [x] Variables pointing to an unknown attribute are ignored if ignoreUnknownAttributes() is called - [x] Variables pointing to an unknown attribute are detected if detectUnknownAttributes() is called after ignoreUnknownAttributes() - [x] Variables pointing to a safe attribute are safe - [x] Variables pointing to an unsafe attribute are unsafe - [x] Variables pointing to a safe variable are safe - [x] Variables pointing to an unsafe variable are unsafe - [x] Variables pointing to a stylesheet parameter are safe - [x] Variables pointing to a stylesheet parameter of the same name are safe - [x] Local parameters pointing to an unknown attribute are unsafe - [x] Local parameters pointing to a safe attribute are safe - [x] Attributes are not safe if the tag's filterChain is cleared - [x] Attributes are not safe if the tag's filterChain does not contain the default attribute filter - [x] Attributes can be safe with the tag's default filterChain - [x] Multiple attributes can be safe - [x] Multiple attributes can be unsafe - Disallow Attribute Sets (s9e\TextFormatter\Tests\Configurator\TemplateChecks\DisallowAttributeSets) [x] Disallowed: [x] Allowed: ... @@ -3379,17 +3360,6 @@ Restrict Flash Script Access (s9e\TextFormatter\Tests\Configurator\TemplateCheck [x] 'never',true disallows [x] 'never',true disallows -Abstract Normalization (s9e\TextFormatter\Tests\Configurator\AbstractNormalization) - [x] Nothing happens if the normalization doesn't override any method or set any query - [x] Nothing happens if the normalization doesn't override any method but set an element query - [x] Nothing happens if the normalization doesn't override any method but set an attribute query - [x] Calls normalizeAttribute() if an XPath query returns a DOMElement - [x] Calls normalizeElement() if an XPath query returns a DOMElement - [x] Nodes removed during normalization are not processed further - [x] Can create elements and text nodes - [x] isXsl() differentiates between XSL elements and others - [x] lowercase() works - Add Attribute Value To Elements (s9e\TextFormatter\Tests\Configurator\TemplateNormalizations\AddAttributeValueToElements) [x] Works with data set #0 [x] Works with data set #1 diff --git a/tests/BundleTest.php b/tests/BundleTest.php index 3c34958560..0a03b3be82 100644 --- a/tests/BundleTest.php +++ b/tests/BundleTest.php @@ -31,7 +31,7 @@ public function testParse() $text = 'Hello world'; $xml = 'Hello world'; - $mock = $this->getMockBuilder('stdClass')->setMethods(['parse'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['parse'])->getMock(); $mock->expects($this->once()) ->method('parse') ->with($text) @@ -54,10 +54,9 @@ public function testParseSingleton() $text2 = 'Sup Earth :)'; $xml2 = 'Sup Earth :)'; - $mock = $this->getMockBuilder('stdClass')->setMethods(['parse'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['parse'])->getMock(); $mock->expects($this->exactly(2)) ->method('parse') - ->withConsecutive([$text1], [$text2]) ->willReturnOnConsecutiveCalls($xml1, $xml2); DummyBundle::$_parser = $mock; @@ -72,7 +71,7 @@ public function testParseSingleton() */ public function testBeforeParse() { - $mock = $this->getMockBuilder('stdClass')->setMethods(['parse'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['parse'])->getMock(); $mock->expects($this->once()) ->method('parse') ->with('beforeParse') @@ -94,7 +93,7 @@ public function testBeforeParse() */ public function testAfterParse() { - $mock = $this->getMockBuilder('stdClass')->setMethods(['parse'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['parse'])->getMock(); $mock->expects($this->once()) ->method('parse') ->with('') @@ -119,7 +118,7 @@ public function testRender() $xml = 'Hello world'; $html = 'Hello world'; - $mock = $this->getMockBuilder('stdClass')->setMethods(['render', 'setParameters'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['render', 'setParameters'])->getMock(); $mock->expects($this->once()) ->method('render') ->with($xml) @@ -139,7 +138,7 @@ public function testRenderSingleton() $xml = 'Hello world'; $html = 'Hello world'; - $mock = $this->getMockBuilder('stdClass')->setMethods(['render', 'setParameters'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['render', 'setParameters'])->getMock(); $mock->expects($this->exactly(2)) ->method('render') ->with($xml) @@ -161,7 +160,7 @@ public function testRenderParameters() $html = 'Hello world'; $params = ['foo' => 'bar']; - $mock = $this->getMockBuilder('stdClass')->setMethods(['render', 'setParameters'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['render', 'setParameters'])->getMock(); $mock->expects($this->once()) ->method('render') ->with($xml) @@ -181,7 +180,7 @@ public function testRenderParameters() */ public function testBeforeRender() { - $mock = $this->getMockBuilder('stdClass')->setMethods(['render'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['render'])->getMock(); $mock->expects($this->once()) ->method('render') ->with('beforeRender') @@ -203,7 +202,7 @@ public function testBeforeRender() */ public function testAfterRender() { - $mock = $this->getMockBuilder('stdClass')->setMethods(['render'])->getMock(); + $mock = $this->getMockBuilder('stdClass')->addMethods(['render'])->getMock(); $mock->expects($this->once()) ->method('render') ->with('') @@ -297,7 +296,7 @@ public static function _reset(Test $test) self::$calls = ['getParser' => 0, 'getRenderer' => 0]; $mock = $test->getMockBuilder('stdClass') - ->setMethods(['parse', 'render', 'setParameters']) + ->addMethods(['parse', 'render', 'setParameters']) ->getMock(); $mock->expects($test->never())->method('parse'); $mock->expects($test->never())->method('render'); diff --git a/tests/Bundles/AbstractTest.php b/tests/Bundles/AbstractTestClass.php similarity index 98% rename from tests/Bundles/AbstractTest.php rename to tests/Bundles/AbstractTestClass.php index 16dfa6aaa4..e1f8f24c92 100644 --- a/tests/Bundles/AbstractTest.php +++ b/tests/Bundles/AbstractTestClass.php @@ -7,7 +7,7 @@ /** * @covers s9e\TextFormatter\Bundle */ -abstract class AbstractTest extends Test +abstract class AbstractTestClass extends Test { protected static function getBundleName() { @@ -194,7 +194,7 @@ public function testRender($text, $expected, $params = []) $this->runRenderingTest($text, $expected, $params, false); } - public function getRenderingTests() + public static function getRenderingTests() { $bundleName = static::getBundleName(); diff --git a/tests/Bundles/FatdownTest.php b/tests/Bundles/FatdownTest.php index 5c932d3be7..96f01ae6d5 100644 --- a/tests/Bundles/FatdownTest.php +++ b/tests/Bundles/FatdownTest.php @@ -6,7 +6,7 @@ * @covers s9e\TextFormatter\Bundles\Fatdown * @covers s9e\TextFormatter\Bundles\Fatdown\Renderer */ -class FatdownTest extends AbstractTest +class FatdownTest extends AbstractTestClass { protected function postprocessActualHtml(string $html): string { diff --git a/tests/Bundles/ForumTest.php b/tests/Bundles/ForumTest.php index 1801192934..79d7cdf95c 100644 --- a/tests/Bundles/ForumTest.php +++ b/tests/Bundles/ForumTest.php @@ -8,6 +8,6 @@ * @covers s9e\TextFormatter\Bundles\Forum * @covers s9e\TextFormatter\Bundles\Forum\Renderer */ -class ForumTest extends AbstractTest +class ForumTest extends AbstractTestClass { } \ No newline at end of file diff --git a/tests/Bundles/MediaPackTest.php b/tests/Bundles/MediaPackTest.php index a9a2fc0a00..ef56d23e3f 100644 --- a/tests/Bundles/MediaPackTest.php +++ b/tests/Bundles/MediaPackTest.php @@ -6,6 +6,6 @@ * @covers s9e\TextFormatter\Bundles\MediaPack * @covers s9e\TextFormatter\Bundles\MediaPack\Renderer */ -class MediaPackTest extends AbstractTest +class MediaPackTest extends AbstractTestClass { } \ No newline at end of file diff --git a/tests/Configurator/BundleGeneratorTest.php b/tests/Configurator/BundleGeneratorTest.php index 22c234efba..a65dd0698f 100644 --- a/tests/Configurator/BundleGeneratorTest.php +++ b/tests/Configurator/BundleGeneratorTest.php @@ -72,7 +72,7 @@ public function testFileHeader() public function testCustomSerializer() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['serialize']) + ->addMethods(['serialize']) ->getMock(); $mock->expects($this->any()) ->method('serialize') @@ -210,7 +210,7 @@ public function testExportCallback($namespace, $original, $expected) $this->assertSame($expected, $actual); } - public function getExportCallbackTests() + public static function getExportCallbackTests() { return [ [ @@ -274,7 +274,7 @@ public function testExportObject($original, $expected) $this->assertEquals($original, eval('return ' . $actual . ';'), 'Not reversible'); } - public function getExportObjectTests() + public static function getExportObjectTests() { return [ [ diff --git a/tests/Configurator/Collections/NormalizedCollectionTest.php b/tests/Configurator/Collections/NormalizedCollectionTest.php index 35ad4e632e..184212da2e 100644 --- a/tests/Configurator/Collections/NormalizedCollectionTest.php +++ b/tests/Configurator/Collections/NormalizedCollectionTest.php @@ -15,7 +15,7 @@ class NormalizedCollectionTest extends Test { protected function getMockCollection() { - return $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\Collections\\NormalizedCollection')->setMethods(func_get_args())->getMock(); + return $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\Collections\\NormalizedCollection')->onlyMethods(func_get_args())->getMock(); } /** diff --git a/tests/Configurator/Collections/NormalizedListTest.php b/tests/Configurator/Collections/NormalizedListTest.php index 75ca902e36..618c3b1085 100644 --- a/tests/Configurator/Collections/NormalizedListTest.php +++ b/tests/Configurator/Collections/NormalizedListTest.php @@ -36,7 +36,7 @@ public function testAppend() public function testArrayAccessAppend() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\Collections\\NormalizedList') - ->setMethods(['append']) + ->onlyMethods(['append']) ->getMock(); $mock->expects($this->once()) diff --git a/tests/Configurator/Exceptions/UnsafeTemplateExceptionTest.php b/tests/Configurator/Exceptions/UnsafeTemplateExceptionTest.php index fc6e15f03b..d05aea94c5 100644 --- a/tests/Configurator/Exceptions/UnsafeTemplateExceptionTest.php +++ b/tests/Configurator/Exceptions/UnsafeTemplateExceptionTest.php @@ -63,7 +63,7 @@ public function testHighlightNode($template, $expected) $this->assertSame($expected, $e->highlightNode()); } - public function getHighlights() + public static function getHighlights() { return [ [ diff --git a/tests/Configurator/Helpers/AVTHelperTest.php b/tests/Configurator/Helpers/AVTHelperTest.php index 2312a7ff23..9fddfb2133 100644 --- a/tests/Configurator/Helpers/AVTHelperTest.php +++ b/tests/Configurator/Helpers/AVTHelperTest.php @@ -22,7 +22,7 @@ public function testParse($attrValue, $expected) $this->assertSame($expected, AVTHelper::parse($attrValue)); } - public function getParseTests() + public static function getParseTests() { return [ [ @@ -131,7 +131,7 @@ public function testSerialize($tokens, $expected) $this->assertSame($expected, AVTHelper::serialize($tokens)); } - public function getSerializeTests() + public static function getSerializeTests() { return [ [ @@ -199,7 +199,7 @@ public function testReplace($xml, $callback, $expected) $this->assertSame($expected, $dom->saveXML($dom->documentElement)); } - public function getReplaceTests() + public static function getReplaceTests() { return [ [ @@ -238,7 +238,7 @@ public function testToXSL($attrValue, $expected) $this->assertSame($expected, AVTHelper::toXSL($attrValue)); } - public function getToXSLTests() + public static function getToXSLTests() { return [ [ diff --git a/tests/Configurator/Helpers/ElementInspectorTest.php b/tests/Configurator/Helpers/ElementInspectorTest.php index 8cfeb276ee..01acf43425 100644 --- a/tests/Configurator/Helpers/ElementInspectorTest.php +++ b/tests/Configurator/Helpers/ElementInspectorTest.php @@ -26,7 +26,7 @@ public function test($methodName, $args, $expected) $this->assertEquals($expected, $actual); } - public function getElementInspectorTests() + public static function getElementInspectorTests() { return [ [ diff --git a/tests/Configurator/Helpers/FilterHelperTest.php b/tests/Configurator/Helpers/FilterHelperTest.php index 9c264605ee..1a182f31ab 100644 --- a/tests/Configurator/Helpers/FilterHelperTest.php +++ b/tests/Configurator/Helpers/FilterHelperTest.php @@ -21,7 +21,7 @@ public function testIsAllowed(string $filter, array $allowed, bool $expected) $this->assertEquals($expected, FilterHelper::isAllowed($filter, $allowed)); } - public function getIsAllowedTests() + public static function getIsAllowedTests() { return [ [ @@ -73,7 +73,7 @@ public function testParse($filterString, $expected) $this->assertEquals($expected, FilterHelper::parse($filterString)); } - public function getParseTests() + public static function getParseTests() { return [ [ diff --git a/tests/Configurator/Helpers/FilterSyntaxMatcherTest.php b/tests/Configurator/Helpers/FilterSyntaxMatcherTest.php index 72f61d3d1b..aaa3b65a9b 100644 --- a/tests/Configurator/Helpers/FilterSyntaxMatcherTest.php +++ b/tests/Configurator/Helpers/FilterSyntaxMatcherTest.php @@ -31,7 +31,7 @@ public function testParse($filterString, $expected) $this->assertEquals($expected, $parser->parse($filterString)['value']); } - public function getParseTests() + public static function getParseTests() { return [ [ diff --git a/tests/Configurator/Helpers/NodeLocatorTest.php b/tests/Configurator/Helpers/NodeLocatorTest.php index ad5cada83d..6f100ee4b0 100644 --- a/tests/Configurator/Helpers/NodeLocatorTest.php +++ b/tests/Configurator/Helpers/NodeLocatorTest.php @@ -85,7 +85,7 @@ public function testGetURLNodes($template, $query = null) $this->runTestGetNodes('getURLNodes', [], $template, $query); } - public function getObjectParamsByRegexpTests() + public static function getObjectParamsByRegexpTests() { return [ [ @@ -131,7 +131,7 @@ public function getObjectParamsByRegexpTests() ]; } - public function getCSSNodesTests() + public static function getCSSNodesTests() { return [ [ @@ -176,7 +176,7 @@ public function getCSSNodesTests() ]; } - public function getJSNodesTests() + public static function getJSNodesTests() { return [ [ @@ -225,7 +225,7 @@ public function getJSNodesTests() ]; } - public function getURLNodesTests() + public static function getURLNodesTests() { return [ [ diff --git a/tests/Configurator/Helpers/RegexpParserTest.php b/tests/Configurator/Helpers/RegexpParserTest.php index 5467981e8a..3c53770886 100644 --- a/tests/Configurator/Helpers/RegexpParserTest.php +++ b/tests/Configurator/Helpers/RegexpParserTest.php @@ -760,7 +760,7 @@ public function testGetAllowedCharacterRegexp($regexp, $results) } } - public function getAllowedCharacterRegexpData() + public static function getAllowedCharacterRegexpData() { return [ [ @@ -1145,7 +1145,7 @@ public function testGetCaptureNamesTests($regexp, array $expected) $this->assertSame($expected, RegexpParser::getCaptureNames($regexp)); } - public function getGetCaptureNamesTests() + public static function getGetCaptureNamesTests() { return [ [ diff --git a/tests/Configurator/Helpers/TemplateHelperTest.php b/tests/Configurator/Helpers/TemplateHelperTest.php index 09fe222d0d..70dd96a54d 100644 --- a/tests/Configurator/Helpers/TemplateHelperTest.php +++ b/tests/Configurator/Helpers/TemplateHelperTest.php @@ -32,7 +32,7 @@ public function testGetParametersFromXSL($xsl, $expected) ); } - public function getParametersTests() + public static function getParametersTests() { return [ [ @@ -120,7 +120,7 @@ public function testHighlightNode($query, $template, $expected) ); } - public function getHighlights() + public static function getHighlights() { return [ [ @@ -212,7 +212,7 @@ public function testReplaceHomogeneousTemplates($templates, $expected) $this->assertSame($expected, $templates); } - public function getReplaceHomogeneousTemplatesTests() + public static function getReplaceHomogeneousTemplatesTests() { return [ [ diff --git a/tests/Configurator/Helpers/TemplateInspectorTest.php b/tests/Configurator/Helpers/TemplateInspectorTest.php index 1e65207371..49ce59ea1c 100644 --- a/tests/Configurator/Helpers/TemplateInspectorTest.php +++ b/tests/Configurator/Helpers/TemplateInspectorTest.php @@ -36,7 +36,7 @@ public function test($title, $xslSrc, $rule, $xslTrg = null) $this->$assert($src->$method($trg), $title); } - public function getTemplateInspectorTests() + public static function getTemplateInspectorTests() { return [ [ diff --git a/tests/Configurator/Helpers/TemplateModifierTest.php b/tests/Configurator/Helpers/TemplateModifierTest.php index 394c0c25c7..b12a515a16 100644 --- a/tests/Configurator/Helpers/TemplateModifierTest.php +++ b/tests/Configurator/Helpers/TemplateModifierTest.php @@ -30,7 +30,7 @@ public function testReplaceTokens($template, $regexp, $fn, $expected) ); } - public function replaceTokensTests() + public static function replaceTokensTests() { return [ [ diff --git a/tests/Configurator/Helpers/TemplateParserTest.php b/tests/Configurator/Helpers/TemplateParserTest.php index 2bbe882989..4cf9d490d6 100644 --- a/tests/Configurator/Helpers/TemplateParserTest.php +++ b/tests/Configurator/Helpers/TemplateParserTest.php @@ -27,7 +27,7 @@ public function testParse($template, $expectedFile) $this->assertXmlStringEqualsXmlFile($expectedFile, $ir->saveXML()); } - public function getParseTests() + public static function getParseTests() { $tests = []; foreach (glob(__DIR__ . '/data/TemplateParser/*.template') as $filepath) diff --git a/tests/Configurator/Helpers/XPathHelperTest.php b/tests/Configurator/Helpers/XPathHelperTest.php index 3d00359af6..f58ee88d78 100644 --- a/tests/Configurator/Helpers/XPathHelperTest.php +++ b/tests/Configurator/Helpers/XPathHelperTest.php @@ -30,7 +30,7 @@ public function testGetVariables($expr, $expected) $this->assertSame($expected, XPathHelper::getVariables($expr)); } - public function getGetVariablesTests() + public static function getGetVariablesTests() { return [ [ @@ -61,7 +61,7 @@ public function testIsExpressionNumeric($expected, $expr) $this->assertSame($expected, XPathHelper::isExpressionNumeric($expr)); } - public function getIsExpressionNumericTests() + public static function getIsExpressionNumericTests() { return [ [false, '@foo'], @@ -111,7 +111,7 @@ public function testMinify($original, $expected) } } - public function getMinifyTests() + public static function getMinifyTests() { return [ [ @@ -246,7 +246,7 @@ public function testParseEqualityExpr($expr, $expected) $this->assertSame($expected, XPathHelper::parseEqualityExpr($expr)); } - public function getParseEqualityExprTests() + public static function getParseEqualityExprTests() { return [ [ diff --git a/tests/Configurator/Items/AttributeFilters/ChoiceFilterTest.php b/tests/Configurator/Items/AttributeFilters/ChoiceFilterTest.php index 76543e2954..f45d7b587e 100644 --- a/tests/Configurator/Items/AttributeFilters/ChoiceFilterTest.php +++ b/tests/Configurator/Items/AttributeFilters/ChoiceFilterTest.php @@ -31,7 +31,7 @@ public function testConstructorArguments() $className = 's9e\\TextFormatter\\Configurator\\Items\\AttributeFilters\\ChoiceFilter'; $filter = $this->getMockBuilder($className) ->disableOriginalConstructor() - ->setMethods(['setValues']) + ->onlyMethods(['setValues']) ->getMock(); $filter->expects($this->once()) @@ -47,7 +47,7 @@ public function testConstructorArguments() public function testSetValues() { $filter = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\Items\\AttributeFilters\\ChoiceFilter') - ->setMethods(['setRegexp']) + ->onlyMethods(['setRegexp']) ->getMock(); $filter->expects($this->once()) @@ -65,7 +65,7 @@ public function testSetValuesCaseSensitive() $className = 's9e\\TextFormatter\\Configurator\\Items\\AttributeFilters\\ChoiceFilter'; $filter = $this->getMockBuilder($className) ->disableOriginalConstructor() - ->setMethods(['setRegexp']) + ->onlyMethods(['setRegexp']) ->getMock(); $filter->expects($this->once()) @@ -81,7 +81,7 @@ public function testSetValuesCaseSensitive() public function testSetValuesUnicode() { $filter = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\Items\\AttributeFilters\\ChoiceFilter') - ->setMethods(['setRegexp']) + ->onlyMethods(['setRegexp']) ->getMock(); $filter->expects($this->once()) diff --git a/tests/Configurator/Items/AttributeFilters/HashmapFilterTest.php b/tests/Configurator/Items/AttributeFilters/HashmapFilterTest.php index 95ed540a9e..ad5195841e 100644 --- a/tests/Configurator/Items/AttributeFilters/HashmapFilterTest.php +++ b/tests/Configurator/Items/AttributeFilters/HashmapFilterTest.php @@ -31,7 +31,7 @@ public function testConstructorArguments() { $className = 's9e\\TextFormatter\\Configurator\\Items\\AttributeFilters\\HashmapFilter'; $filter = $this->getMockBuilder($className) - ->setMethods(['setMap']) + ->onlyMethods(['setMap']) ->getMock(); $filter->expects($this->once()) diff --git a/tests/Configurator/Items/AttributeFilters/MapFilterTest.php b/tests/Configurator/Items/AttributeFilters/MapFilterTest.php index bba7e98604..9d9b32d157 100644 --- a/tests/Configurator/Items/AttributeFilters/MapFilterTest.php +++ b/tests/Configurator/Items/AttributeFilters/MapFilterTest.php @@ -32,7 +32,7 @@ public function testConstructorArguments() $className = 's9e\\TextFormatter\\Configurator\\Items\\AttributeFilters\\MapFilter'; $filter = $this->getMockBuilder($className) ->disableOriginalConstructor() - ->setMethods(['setMap']) + ->onlyMethods(['setMap']) ->getMock(); $filter->expects($this->once()) diff --git a/tests/Configurator/Items/AttributeFilters/RangeFilterTest.php b/tests/Configurator/Items/AttributeFilters/RangeFilterTest.php index 51faaf9487..065fb98e7a 100644 --- a/tests/Configurator/Items/AttributeFilters/RangeFilterTest.php +++ b/tests/Configurator/Items/AttributeFilters/RangeFilterTest.php @@ -58,7 +58,7 @@ public function testConstructorArguments() $className = 's9e\\TextFormatter\\Configurator\\Items\\AttributeFilters\\RangeFilter'; $filter = $this->getMockBuilder($className) ->disableOriginalConstructor() - ->setMethods(['setRange']) + ->onlyMethods(['setRange']) ->getMock(); $filter->expects($this->once()) diff --git a/tests/Configurator/Items/AttributeFilters/RegexpFilterTest.php b/tests/Configurator/Items/AttributeFilters/RegexpFilterTest.php index aca06ec5c7..4fd3bac596 100644 --- a/tests/Configurator/Items/AttributeFilters/RegexpFilterTest.php +++ b/tests/Configurator/Items/AttributeFilters/RegexpFilterTest.php @@ -306,7 +306,7 @@ public function testConstructorArguments() $className = 's9e\\TextFormatter\\Configurator\\Items\\AttributeFilters\\RegexpFilter'; $filter = $this->getMockBuilder($className) ->disableOriginalConstructor() - ->setMethods(['setRegexp']) + ->onlyMethods(['setRegexp']) ->getMock(); $filter->expects($this->once()) diff --git a/tests/Configurator/Items/TemplateTest.php b/tests/Configurator/Items/TemplateTest.php index 11fd383cd6..8cb0c74933 100644 --- a/tests/Configurator/Items/TemplateTest.php +++ b/tests/Configurator/Items/TemplateTest.php @@ -99,7 +99,7 @@ public function testIsNormalizedCalled() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\TemplateNormalizer') ->disableOriginalConstructor() - ->setMethods(['normalizeTemplate']) + ->onlyMethods(['normalizeTemplate']) ->getMock(); $template = new Template('
'); @@ -151,7 +151,7 @@ public function testNormalizeResetsInspector() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\TemplateNormalizer') ->disableOriginalConstructor() - ->setMethods(['normalizeTemplate']) + ->onlyMethods(['normalizeTemplate']) ->getMock(); $mock->expects($this->any())->method('normalizeTemplate')->willReturn('
'); @@ -204,7 +204,7 @@ public function testReplaceTokensResetsIsNormalized() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\TemplateNormalizer') ->disableOriginalConstructor() - ->setMethods(['normalizeTemplate']) + ->onlyMethods(['normalizeTemplate']) ->getMock(); $template = new Template('
'); diff --git a/tests/Configurator/JavaScript/CallbackGeneratorTest.php b/tests/Configurator/JavaScript/CallbackGeneratorTest.php index 74b2f3565f..93b288f41b 100644 --- a/tests/Configurator/JavaScript/CallbackGeneratorTest.php +++ b/tests/Configurator/JavaScript/CallbackGeneratorTest.php @@ -22,7 +22,7 @@ public function testReplaceCallbacks($original, $expected) $this->assertEquals($expected, $generator->replaceCallbacks($original)); } - public function getReplaceCallbacksTests() + public static function getReplaceCallbacksTests() { return [ [ diff --git a/tests/Configurator/JavaScript/ConfigOptimizerTest.php b/tests/Configurator/JavaScript/ConfigOptimizerTest.php index fa6b8f0b84..48cf992d64 100644 --- a/tests/Configurator/JavaScript/ConfigOptimizerTest.php +++ b/tests/Configurator/JavaScript/ConfigOptimizerTest.php @@ -39,7 +39,7 @@ public function testOptimizeObject($original, $expected, $objects) $this->assertSame(implode("\n", $objects), rtrim($optimizer->getVarDeclarations())); } - public function getOptimizeObjectTests() + public static function getOptimizeObjectTests() { return [ [ diff --git a/tests/Configurator/JavaScript/EncoderTest.php b/tests/Configurator/JavaScript/EncoderTest.php index aa2d10d547..e7c2a61de0 100644 --- a/tests/Configurator/JavaScript/EncoderTest.php +++ b/tests/Configurator/JavaScript/EncoderTest.php @@ -25,7 +25,7 @@ public function testEncode($original, $expected) $this->assertSame($expected, $encoder->encode($original)); } - public function getEncodeTests() + public static function getEncodeTests() { return [ [ diff --git a/tests/Configurator/JavaScript/FunctionCacheTest.php b/tests/Configurator/JavaScript/FunctionCacheTest.php index 8571b28d67..89998e923c 100644 --- a/tests/Configurator/JavaScript/FunctionCacheTest.php +++ b/tests/Configurator/JavaScript/FunctionCacheTest.php @@ -24,7 +24,7 @@ public function testAddFromXSL($template, $expected) $this->assertEquals($expected, $functionCache->getJSON()); } - public function getAddFromXSLTests() + public static function getAddFromXSLTests() { return [ [ diff --git a/tests/Configurator/JavaScript/HasherTest.php b/tests/Configurator/JavaScript/HasherTest.php index e46664dab8..269b9a8775 100644 --- a/tests/Configurator/JavaScript/HasherTest.php +++ b/tests/Configurator/JavaScript/HasherTest.php @@ -19,7 +19,7 @@ public function testQuickHash($expected, $text) $this->assertSame($expected, Hasher::quickHash($text)); } - public function getQuickHashTests() + public static function getQuickHashTests() { // These values were computed manually in node.js hash() from render.js // diff --git a/tests/Configurator/JavaScript/MinifierTest.php b/tests/Configurator/JavaScript/MinifierTest.php index 96caed5e5e..2d05ea57e0 100644 --- a/tests/Configurator/JavaScript/MinifierTest.php +++ b/tests/Configurator/JavaScript/MinifierTest.php @@ -36,7 +36,7 @@ public function testMinify() $expected = "alert('Sup world')"; $stub = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\JavaScript\\Minifier') - ->setMethods(['getCacheDifferentiator', 'minify']) + ->onlyMethods(['getCacheDifferentiator', 'minify']) ->getMock(); $stub->expects($this->once()) ->method('minify') diff --git a/tests/Configurator/JavaScript/StylesheetCompressorTest.php b/tests/Configurator/JavaScript/StylesheetCompressorTest.php index 67c8678515..e5ce79c91d 100644 --- a/tests/Configurator/JavaScript/StylesheetCompressorTest.php +++ b/tests/Configurator/JavaScript/StylesheetCompressorTest.php @@ -21,7 +21,7 @@ public function testEncode($original, $expected) $this->assertSame($expected, $stylesheetCompressor->encode($original)); } - public function getEncodeTests() + public static function getEncodeTests() { $tests = []; $dir = __DIR__ . '/data/StylesheetCompressor/'; diff --git a/tests/Configurator/JavaScriptTest.php b/tests/Configurator/JavaScriptTest.php index 6407c811c1..1dda4e77a1 100644 --- a/tests/Configurator/JavaScriptTest.php +++ b/tests/Configurator/JavaScriptTest.php @@ -102,7 +102,7 @@ public function testSetMinifierReturn() public function testMinifierReturn() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\JavaScript\\Minifier') - ->setMethods(['minify']) + ->onlyMethods(['minify']) ->getMock(); $mock->expects($this->once()) ->method('minify') diff --git a/tests/Configurator/RecursiveParserTest.php b/tests/Configurator/RecursiveParserTest.php index 6b744a0e68..aeef358968 100644 --- a/tests/Configurator/RecursiveParserTest.php +++ b/tests/Configurator/RecursiveParserTest.php @@ -37,7 +37,7 @@ public function test($str, $expected, $restrict = '') $this->assertEquals($expected, $parser->parse($str, $restrict)); } - public function getParseTests() + public static function getParseTests() { return [ [ diff --git a/tests/Configurator/RendererGenerators/PHP/BranchOutputOptimizerTest.php b/tests/Configurator/RendererGenerators/PHP/BranchOutputOptimizerTest.php index b5a0298285..6a4b3a34a8 100644 --- a/tests/Configurator/RendererGenerators/PHP/BranchOutputOptimizerTest.php +++ b/tests/Configurator/RendererGenerators/PHP/BranchOutputOptimizerTest.php @@ -25,7 +25,7 @@ public function testBranchOutputOptimization($original, $expected) $this->assertSame($expected, $optimizer->optimize(token_get_all('assertSame($expected, $optimizer->optimize($original)); } - public function getControlStructureOptimizationTests() + public static function getControlStructureOptimizationTests() { return [ [ diff --git a/tests/Configurator/RendererGenerators/PHP/OptimizerTest.php b/tests/Configurator/RendererGenerators/PHP/OptimizerTest.php index 173726cec7..a13fe056a1 100644 --- a/tests/Configurator/RendererGenerators/PHP/OptimizerTest.php +++ b/tests/Configurator/RendererGenerators/PHP/OptimizerTest.php @@ -22,7 +22,7 @@ public function testOptimizations($original, $expected) $this->assertSame($expected, $optimizer->optimize($original)); } - public function getOptimizationTests() + public static function getOptimizationTests() { return [ [ diff --git a/tests/Configurator/RendererGenerators/PHP/QuickTest.php b/tests/Configurator/RendererGenerators/PHP/QuickTest.php index a27cf17c34..d976f671b4 100644 --- a/tests/Configurator/RendererGenerators/PHP/QuickTest.php +++ b/tests/Configurator/RendererGenerators/PHP/QuickTest.php @@ -114,7 +114,7 @@ public function testRendering($templates, $xml, $expected, $setup = null) $this->assertSame($expected, $renderer->render($xml)); } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ @@ -320,7 +320,7 @@ public function testRenderingStrategy($template, $expected, $setup = null) $this->assertEquals($expected, Quick::getRenderingStrategy($php)); } - public function getRenderingStrategyTests() + public static function getRenderingStrategyTests() { return [ [ @@ -632,7 +632,7 @@ public function testSource($templates, $contains, $setup = null) $this->assertStringContainsString($contains, Quick::getSource($compiledTemplates)); } - public function getSourceTests() + public static function getSourceTests() { return [ [ diff --git a/tests/Configurator/RendererGenerators/PHP/SerializerTest.php b/tests/Configurator/RendererGenerators/PHP/SerializerTest.php index e56ae0acae..2e16796ea3 100644 --- a/tests/Configurator/RendererGenerators/PHP/SerializerTest.php +++ b/tests/Configurator/RendererGenerators/PHP/SerializerTest.php @@ -38,7 +38,7 @@ public function testSerialize($xml, $expected, $setup = null) $this->assertSame($expected, $serializer->serialize($ir->documentElement)); } - public function getSerializeTests() + public static function getSerializeTests() { return [ [ diff --git a/tests/Configurator/RendererGenerators/PHP/SwitchStatementTest.php b/tests/Configurator/RendererGenerators/PHP/SwitchStatementTest.php index a78cb06147..4c1e8e59aa 100644 --- a/tests/Configurator/RendererGenerators/PHP/SwitchStatementTest.php +++ b/tests/Configurator/RendererGenerators/PHP/SwitchStatementTest.php @@ -19,7 +19,7 @@ public function testGenerate($expr, array $branchesCode, $defaultCode, $expected $this->assertSame($expected, SwitchStatement::generate($expr, $branchesCode, $defaultCode)); } - public function getGenerateTests() + public static function getGenerateTests() { return [ [ diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/AbstractConvertorTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/AbstractConvertorTestClass.php similarity index 94% rename from tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/AbstractConvertorTest.php rename to tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/AbstractConvertorTestClass.php index 13d56a6d85..e75c46cd03 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/AbstractConvertorTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/AbstractConvertorTestClass.php @@ -16,7 +16,7 @@ /** * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor */ -abstract class AbstractConvertorTest extends Test +abstract class AbstractConvertorTestClass extends Test { /** * @dataProvider getConvertorTests @@ -49,5 +49,5 @@ protected function getMatchers($parser) return $matchers; } - abstract public function getConvertorTests(); + abstract public static function getConvertorTests(); } \ No newline at end of file diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/BooleanFunctionsTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/BooleanFunctionsTest.php index f33c2d2723..60e6dc1b72 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/BooleanFunctionsTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/BooleanFunctionsTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\BooleanFunctions */ -class BooleanFunctionsTest extends AbstractConvertorTest +class BooleanFunctionsTest extends AbstractConvertorTestClass { - public function getConvertorTests() + public static function getConvertorTests() { return [ // BooleanParam diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/BooleanOperatorsTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/BooleanOperatorsTest.php index 95b925f586..bd6ad3972a 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/BooleanOperatorsTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/BooleanOperatorsTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\BooleanOperators */ -class BooleanOperatorsTest extends AbstractConvertorTest +class BooleanOperatorsTest extends AbstractConvertorTestClass { - public function getConvertorTests() + public static function getConvertorTests() { return [ // And diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/ComparisonsTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/ComparisonsTest.php index 2c19fe11c2..78d12ca235 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/ComparisonsTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/ComparisonsTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\Comparisons */ -class ComparisonsTest extends AbstractConvertorTest +class ComparisonsTest extends AbstractConvertorTestClass { - public function getConvertorTests() + public static function getConvertorTests() { return [ // Eq diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/CoreTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/CoreTest.php index f88436b1f0..d28362cf56 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/CoreTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/CoreTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\Core */ -class CoreTest extends AbstractConvertorTest +class CoreTest extends AbstractConvertorTestClass { - public function getConvertorTests() + public static function getConvertorTests() { return [ // Attribute diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/MathTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/MathTest.php index 21e1b919ad..7473a6f0e5 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/MathTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/MathTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\Math */ -class MathTest extends AbstractConvertorTest +class MathTest extends AbstractConvertorTestClass { - public function getConvertorTests() + public static function getConvertorTests() { return [ // Addition diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/MultiByteStringManipulationTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/MultiByteStringManipulationTest.php index 85d76edfb3..81befeca8a 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/MultiByteStringManipulationTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/MultiByteStringManipulationTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\MultiByteStringManipulation */ -class MultiByteStringManipulationTest extends AbstractConvertorTest +class MultiByteStringManipulationTest extends AbstractConvertorTestClass { - public function getConvertorTests() + public static function getConvertorTests() { return [ // Substring diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/PHP80FunctionsTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/PHP80FunctionsTest.php index 14d68ea2b4..14f5a784b9 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/PHP80FunctionsTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/PHP80FunctionsTest.php @@ -8,7 +8,7 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\PHP80Functions */ -class PHP80FunctionsTest extends AbstractConvertorTest +class PHP80FunctionsTest extends AbstractConvertorTestClass { protected function getMatchers($parser) { @@ -18,7 +18,7 @@ protected function getMatchers($parser) return $matchers; } - public function getConvertorTests() + public static function getConvertorTests() { return [ // Contains diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/SingleByteStringFunctionsTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/SingleByteStringFunctionsTest.php index deaff0538f..7b4e7b7cf9 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/SingleByteStringFunctionsTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/SingleByteStringFunctionsTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\SingleByteStringFunctions */ -class SingleByteStringFunctionsTest extends AbstractConvertorTest +class SingleByteStringFunctionsTest extends AbstractConvertorTestClass { - public function getConvertorTests() + public static function getConvertorTests() { return [ // Contains diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/SingleByteStringManipulationTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/SingleByteStringManipulationTest.php index d0414ff36d..bba9eb73ff 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/SingleByteStringManipulationTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertor/Convertors/SingleByteStringManipulationTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\AbstractConvertor * @covers s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\SingleByteStringManipulation */ -class SingleByteStringManipulationTest extends AbstractConvertorTest +class SingleByteStringManipulationTest extends AbstractConvertorTestClass { - public function getConvertorTests() + public static function getConvertorTests() { return [ // Concat diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php index bd4ea125a4..75082d5618 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php @@ -21,7 +21,7 @@ class XPathConvertorTest extends Test public function testParserConstructor() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\RecursiveParser') - ->setMethods(['parse']) + ->onlyMethods(['parse']) ->getMock(); $mock->expects($this->once()) ->method('parse') @@ -45,7 +45,7 @@ public function testFeatures($features, $original, $expected) $this->assertSame($expected, $convertor->convertXPath($original)); } - public function getFeaturesTests() + public static function getFeaturesTests() { return [ [ @@ -101,7 +101,7 @@ protected function runConvertTest($methodName, $original, $expected) $this->assertSame($expected, $convertor->$methodName($original)); } - public function getConvertXPathTests() + public static function getConvertXPathTests() { return [ [ @@ -253,7 +253,7 @@ public function getConvertXPathTests() ]; } - public function getConvertConditionTests() + public static function getConvertConditionTests() { return [ [ diff --git a/tests/Configurator/RendererGenerators/PHPTest.php b/tests/Configurator/RendererGenerators/PHPTest.php index def29022b4..fae42bacbb 100644 --- a/tests/Configurator/RendererGenerators/PHPTest.php +++ b/tests/Configurator/RendererGenerators/PHPTest.php @@ -319,7 +319,7 @@ protected function runTestEdgeCase($xml, $configuratorSetup, $rendererSetup, $en ); } - public function getEdgeCases() + public static function getEdgeCases() { return [ [ @@ -901,7 +901,7 @@ public function testXPath($template, $contains = null, $notContains = null, $set $this->runCodeTest($template, $contains, $notContains, $setup); } - public function getXPathTests() + public static function getXPathTests() { return [ // XPath in values @@ -967,7 +967,7 @@ public function getXPathTests() public function testCallsOptimizer() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['optimize']) + ->addMethods(['optimize']) ->getMock(); $mock->expects($this->atLeastOnce()) ->method('optimize') @@ -993,7 +993,7 @@ public function testNoOptimizer() public function testCallsControlStructuresOptimizer() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['optimize']) + ->addMethods(['optimize']) ->getMock(); $mock->expects($this->once()) ->method('optimize') @@ -1023,7 +1023,7 @@ public function testOptimizations($xsl, $contains = null, $notContains = null, $ $this->runCodeTest($xsl, $contains, $notContains, $setup); } - public function getOptimizationTests() + public static function getOptimizationTests() { return [ [ @@ -1128,7 +1128,7 @@ public function testHTML($xml, $html, $setup = null, $rendererSetup = null) $this->assertSame($html, $renderer->render($xml)); } - public function getConformanceTests() + public static function getConformanceTests() { return [ [ @@ -1462,7 +1462,7 @@ public function testVoidHTML($xml, $template, $html) $this->assertSame($html, $renderer->render($xml)); } - public function getVoidTests($type) + public static function getVoidTests() { return [ [ @@ -1608,7 +1608,7 @@ function ($configurator, $plugin) use ($setup) ); } - public function getPluginsTests() + public static function getPluginsTests() { $pluginsDir = __DIR__ . '/../../Plugins'; @@ -1618,10 +1618,9 @@ public function getPluginsTests() $pluginName = basename($dirpath); $className = 's9e\\TextFormatter\\Tests\\Plugins\\' . $pluginName . '\\ParserTest'; - $obj = new $className; - if (method_exists($obj, 'getRenderingTests')) + if (method_exists($className, 'getRenderingTests')) { - foreach ($obj->getRenderingTests() as $test) + foreach ($className::getRenderingTests() as $test) { array_unshift($test, $pluginName); $tests[] = $test; @@ -1629,8 +1628,7 @@ public function getPluginsTests() } } - $obj = new BBCodesTest; - foreach ($obj->getPredefinedBBCodesTests() as $test) + foreach (BBCodesTest::getPredefinedBBCodesTests() as $test) { // Insert an empty array for pluginOptions if (isset($test[2])) diff --git a/tests/Configurator/RenderingTest.php b/tests/Configurator/RenderingTest.php index 9e259b3a4b..d58198099d 100644 --- a/tests/Configurator/RenderingTest.php +++ b/tests/Configurator/RenderingTest.php @@ -66,7 +66,7 @@ public function testGetRendererInvokesGenerator() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\RendererGenerators\\XSLT') ->disableOriginalConstructor() - ->setMethods(['getRenderer']) + ->onlyMethods(['getRenderer']) ->getMock(); $mock->expects($this->once()) ->method('getRenderer') diff --git a/tests/Configurator/RulesGeneratorTest.php b/tests/Configurator/RulesGeneratorTest.php index 583656c500..7b633b7c2f 100644 --- a/tests/Configurator/RulesGeneratorTest.php +++ b/tests/Configurator/RulesGeneratorTest.php @@ -49,7 +49,7 @@ public function testDefault($tags, $expected) $this->assertEquals($expected, $rulesGenerator->getRules($tagCollection)); } - public function getDefault() + public static function getDefault() { return [ [ diff --git a/tests/Configurator/RulesGenerators/AbstractTest.php b/tests/Configurator/RulesGenerators/AbstractTestClass.php similarity index 95% rename from tests/Configurator/RulesGenerators/AbstractTest.php rename to tests/Configurator/RulesGenerators/AbstractTestClass.php index dadf60573a..b29de035b2 100644 --- a/tests/Configurator/RulesGenerators/AbstractTest.php +++ b/tests/Configurator/RulesGenerators/AbstractTestClass.php @@ -5,7 +5,7 @@ use s9e\TextFormatter\Configurator\Helpers\TemplateInspector; use s9e\TextFormatter\Tests\Test; -abstract class AbstractTest extends Test +abstract class AbstractTestClass extends Test { public function assertBooleanRules($template, $expected) { diff --git a/tests/Configurator/RulesGenerators/AllowAllTest.php b/tests/Configurator/RulesGenerators/AllowAllTest.php index 19d0685f59..3b31912e47 100644 --- a/tests/Configurator/RulesGenerators/AllowAllTest.php +++ b/tests/Configurator/RulesGenerators/AllowAllTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\AllowAll */ -class AllowAllTest extends AbstractTest +class AllowAllTest extends AbstractTestClass { /** * @testdox has a allowChild rule and a allowDescendant rule for
diff --git a/tests/Configurator/RulesGenerators/AutoCloseIfVoidTest.php b/tests/Configurator/RulesGenerators/AutoCloseIfVoidTest.php index cd1abf9bb9..0ce39986ea 100644 --- a/tests/Configurator/RulesGenerators/AutoCloseIfVoidTest.php +++ b/tests/Configurator/RulesGenerators/AutoCloseIfVoidTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\AutoCloseIfVoid */ -class AutoCloseIfVoidTest extends AbstractTest +class AutoCloseIfVoidTest extends AbstractTestClass { /** * @testdox Generates an autoClose rule for
diff --git a/tests/Configurator/RulesGenerators/AutoReopenFormattingElementsTest.php b/tests/Configurator/RulesGenerators/AutoReopenFormattingElementsTest.php index a524a0a2a4..d1e369daaf 100644 --- a/tests/Configurator/RulesGenerators/AutoReopenFormattingElementsTest.php +++ b/tests/Configurator/RulesGenerators/AutoReopenFormattingElementsTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\AutoReopenFormattingElements */ -class AutoReopenFormattingElementsTest extends AbstractTest +class AutoReopenFormattingElementsTest extends AbstractTestClass { /** * @testdox Generates an autoReopen rule for diff --git a/tests/Configurator/RulesGenerators/BlockElementsCloseFormattingElementsTest.php b/tests/Configurator/RulesGenerators/BlockElementsCloseFormattingElementsTest.php index fc016bf25a..61a1d29a50 100644 --- a/tests/Configurator/RulesGenerators/BlockElementsCloseFormattingElementsTest.php +++ b/tests/Configurator/RulesGenerators/BlockElementsCloseFormattingElementsTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\BlockElementsCloseFormattingElements */ -class BlockElementsCloseFormattingElementsTest extends AbstractTest +class BlockElementsCloseFormattingElementsTest extends AbstractTestClass { /** * @testdox
has a closeParent rule for diff --git a/tests/Configurator/RulesGenerators/BlockElementsFosterFormattingElementsTest.php b/tests/Configurator/RulesGenerators/BlockElementsFosterFormattingElementsTest.php index 17cf38bb8d..9eb8cb0672 100644 --- a/tests/Configurator/RulesGenerators/BlockElementsFosterFormattingElementsTest.php +++ b/tests/Configurator/RulesGenerators/BlockElementsFosterFormattingElementsTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\BlockElementsFosterFormattingElements */ -class BlockElementsFosterFormattingElementsTest extends AbstractTest +class BlockElementsFosterFormattingElementsTest extends AbstractTestClass { /** * @testdox
has a fosterParent rule for diff --git a/tests/Configurator/RulesGenerators/DisableAutoLineBreaksIfNewLinesArePreservedTest.php b/tests/Configurator/RulesGenerators/DisableAutoLineBreaksIfNewLinesArePreservedTest.php index 3019b2eb1b..0c2bb5353b 100644 --- a/tests/Configurator/RulesGenerators/DisableAutoLineBreaksIfNewLinesArePreservedTest.php +++ b/tests/Configurator/RulesGenerators/DisableAutoLineBreaksIfNewLinesArePreservedTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\DisableAutoLineBreaksIfNewLinesArePreserved */ -class DisableAutoLineBreaksIfNewLinesArePreservedTest extends AbstractTest +class DisableAutoLineBreaksIfNewLinesArePreservedTest extends AbstractTestClass { /** * @testdox Does not generate a disableAutoLineBreaks rule for
    diff --git a/tests/Configurator/RulesGenerators/EnforceContentModelsTest.php b/tests/Configurator/RulesGenerators/EnforceContentModelsTest.php index 12224fe267..9ced3dd1d0 100644 --- a/tests/Configurator/RulesGenerators/EnforceContentModelsTest.php +++ b/tests/Configurator/RulesGenerators/EnforceContentModelsTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\EnforceContentModels */ -class EnforceContentModelsTest extends AbstractTest +class EnforceContentModelsTest extends AbstractTestClass { /** * @testdox
    has an allowChild rule and an allowDescendant rule for diff --git a/tests/Configurator/RulesGenerators/EnforceOptionalEndTagsTest.php b/tests/Configurator/RulesGenerators/EnforceOptionalEndTagsTest.php index 3da7f264d4..bb60b10cc4 100644 --- a/tests/Configurator/RulesGenerators/EnforceOptionalEndTagsTest.php +++ b/tests/Configurator/RulesGenerators/EnforceOptionalEndTagsTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\EnforceOptionalEndTags */ -class EnforceOptionalEndTagsTest extends AbstractTest +class EnforceOptionalEndTagsTest extends AbstractTestClass { /** * @testdox
  1. closes parent
  2. diff --git a/tests/Configurator/RulesGenerators/IgnoreTagsInCodeTest.php b/tests/Configurator/RulesGenerators/IgnoreTagsInCodeTest.php index 4d460f1e40..325492766e 100644 --- a/tests/Configurator/RulesGenerators/IgnoreTagsInCodeTest.php +++ b/tests/Configurator/RulesGenerators/IgnoreTagsInCodeTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\IgnoreTagsInCode */ -class IgnoreTagsInCodeTest extends AbstractTest +class IgnoreTagsInCodeTest extends AbstractTestClass { /** * @testdox Generates an ignoreTags rule for diff --git a/tests/Configurator/RulesGenerators/IgnoreTextIfDisallowedTest.php b/tests/Configurator/RulesGenerators/IgnoreTextIfDisallowedTest.php index 4370a3bfae..8a927f2bdf 100644 --- a/tests/Configurator/RulesGenerators/IgnoreTextIfDisallowedTest.php +++ b/tests/Configurator/RulesGenerators/IgnoreTextIfDisallowedTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\IgnoreTextIfDisallowed */ -class IgnoreTextIfDisallowedTest extends AbstractTest +class IgnoreTextIfDisallowedTest extends AbstractTestClass { /** * @testdox Generates an ignoreText rule for
      diff --git a/tests/Configurator/RulesGenerators/IgnoreWhitespaceAroundBlockElementsTest.php b/tests/Configurator/RulesGenerators/IgnoreWhitespaceAroundBlockElementsTest.php index 687963a1aa..14a4989f38 100644 --- a/tests/Configurator/RulesGenerators/IgnoreWhitespaceAroundBlockElementsTest.php +++ b/tests/Configurator/RulesGenerators/IgnoreWhitespaceAroundBlockElementsTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\IgnoreWhitespaceAroundBlockElements */ -class IgnoreWhitespaceAroundBlockElementsTest extends AbstractTest +class IgnoreWhitespaceAroundBlockElementsTest extends AbstractTestClass { /** * @testdox Generates a ignoreSurroundingWhitespace rule for
      diff --git a/tests/Configurator/RulesGenerators/ManageParagraphsTest.php b/tests/Configurator/RulesGenerators/ManageParagraphsTest.php index 712ddc739f..1fb1e7526c 100644 --- a/tests/Configurator/RulesGenerators/ManageParagraphsTest.php +++ b/tests/Configurator/RulesGenerators/ManageParagraphsTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\ManageParagraphs */ -class ManageParagraphsTest extends AbstractTest +class ManageParagraphsTest extends AbstractTestClass { /** * @testdox Generates a breakParagraph rule for
        diff --git a/tests/Configurator/RulesGenerators/TrimFirstLineInCodeBlocksTest.php b/tests/Configurator/RulesGenerators/TrimFirstLineInCodeBlocksTest.php index cfbe264fad..68b28aa44e 100644 --- a/tests/Configurator/RulesGenerators/TrimFirstLineInCodeBlocksTest.php +++ b/tests/Configurator/RulesGenerators/TrimFirstLineInCodeBlocksTest.php @@ -5,7 +5,7 @@ /** * @covers s9e\TextFormatter\Configurator\RulesGenerators\TrimFirstLineInCodeBlocks */ -class TrimFirstLineInCodeBlocksTest extends AbstractTest +class TrimFirstLineInCodeBlocksTest extends AbstractTestClass { /** * @testdox Generates a trimFirstLine rule for
        diff --git a/tests/Configurator/TemplateChecks/AbstractDynamicContentCheckTest.php b/tests/Configurator/TemplateChecks/AbstractDynamicContentCheckTestClass.php similarity index 99% rename from tests/Configurator/TemplateChecks/AbstractDynamicContentCheckTest.php rename to tests/Configurator/TemplateChecks/AbstractDynamicContentCheckTestClass.php index 17c4e7bf97..5e120a6ed5 100644 --- a/tests/Configurator/TemplateChecks/AbstractDynamicContentCheckTest.php +++ b/tests/Configurator/TemplateChecks/AbstractDynamicContentCheckTestClass.php @@ -12,7 +12,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\AbstractDynamicContentCheck */ -class AbstractDynamicContentCheckTest extends AbstractTemplateCheckTest +class AbstractDynamicContentCheckTestClass extends AbstractTemplateCheckTestClass { /** * @testdox Stylesheet parameters are considered safe diff --git a/tests/Configurator/TemplateChecks/AbstractTemplateCheckTest.php b/tests/Configurator/TemplateChecks/AbstractTemplateCheckTestClass.php similarity index 86% rename from tests/Configurator/TemplateChecks/AbstractTemplateCheckTest.php rename to tests/Configurator/TemplateChecks/AbstractTemplateCheckTestClass.php index 205fde111c..44bc28d057 100644 --- a/tests/Configurator/TemplateChecks/AbstractTemplateCheckTest.php +++ b/tests/Configurator/TemplateChecks/AbstractTemplateCheckTestClass.php @@ -5,7 +5,7 @@ use DOMDocument; use s9e\TextFormatter\Tests\Test; -abstract class AbstractTemplateCheckTest extends Test +abstract class AbstractTemplateCheckTestClass extends Test { protected function loadTemplate($template) { diff --git a/tests/Configurator/TemplateChecks/DisallowAttributeSetsTest.php b/tests/Configurator/TemplateChecks/DisallowAttributeSetsTest.php index 38e8ca9795..c4d68c8b73 100644 --- a/tests/Configurator/TemplateChecks/DisallowAttributeSetsTest.php +++ b/tests/Configurator/TemplateChecks/DisallowAttributeSetsTest.php @@ -9,7 +9,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowAttributeSets */ -class DisallowAttributeSetsTest extends AbstractTemplateCheckTest +class DisallowAttributeSetsTest extends AbstractTemplateCheckTestClass { /** * @testdox Disallowed: diff --git a/tests/Configurator/TemplateChecks/DisallowCopyTest.php b/tests/Configurator/TemplateChecks/DisallowCopyTest.php index 1933c6d7fd..76456e715e 100644 --- a/tests/Configurator/TemplateChecks/DisallowCopyTest.php +++ b/tests/Configurator/TemplateChecks/DisallowCopyTest.php @@ -9,7 +9,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowCopy */ -class DisallowCopyTest extends AbstractTemplateCheckTest +class DisallowCopyTest extends AbstractTemplateCheckTestClass { /** * @testdox Disallowed: diff --git a/tests/Configurator/TemplateChecks/DisallowDisableOutputEscapingTest.php b/tests/Configurator/TemplateChecks/DisallowDisableOutputEscapingTest.php index 8a0f393379..60c616a42f 100644 --- a/tests/Configurator/TemplateChecks/DisallowDisableOutputEscapingTest.php +++ b/tests/Configurator/TemplateChecks/DisallowDisableOutputEscapingTest.php @@ -9,7 +9,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowDisableOutputEscaping */ -class DisallowDisableOutputEscapingTest extends AbstractTemplateCheckTest +class DisallowDisableOutputEscapingTest extends AbstractTemplateCheckTestClass { /** * @testdox Disallowed: diff --git a/tests/Configurator/TemplateChecks/DisallowDynamicAttributeNamesTest.php b/tests/Configurator/TemplateChecks/DisallowDynamicAttributeNamesTest.php index b5c896f57d..fa2a98d801 100644 --- a/tests/Configurator/TemplateChecks/DisallowDynamicAttributeNamesTest.php +++ b/tests/Configurator/TemplateChecks/DisallowDynamicAttributeNamesTest.php @@ -9,7 +9,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowDynamicAttributeNames */ -class DisallowDynamicAttributeNamesTest extends AbstractTemplateCheckTest +class DisallowDynamicAttributeNamesTest extends AbstractTemplateCheckTestClass { /** * @testdox Disallowed: diff --git a/tests/Configurator/TemplateChecks/DisallowDynamicElementNamesTest.php b/tests/Configurator/TemplateChecks/DisallowDynamicElementNamesTest.php index 82f9fa4e99..6b93803f34 100644 --- a/tests/Configurator/TemplateChecks/DisallowDynamicElementNamesTest.php +++ b/tests/Configurator/TemplateChecks/DisallowDynamicElementNamesTest.php @@ -9,7 +9,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowDynamicElementNames */ -class DisallowDynamicElementNamesTest extends AbstractTemplateCheckTest +class DisallowDynamicElementNamesTest extends AbstractTemplateCheckTestClass { /** * @testdox Disallowed: diff --git a/tests/Configurator/TemplateChecks/DisallowElementNSTest.php b/tests/Configurator/TemplateChecks/DisallowElementNSTest.php index 5191b0dfe4..cc6ae5cb66 100644 --- a/tests/Configurator/TemplateChecks/DisallowElementNSTest.php +++ b/tests/Configurator/TemplateChecks/DisallowElementNSTest.php @@ -9,7 +9,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowElementNS */ -class DisallowElementNSTest extends AbstractTemplateCheckTest +class DisallowElementNSTest extends AbstractTemplateCheckTestClass { /** * @testdox DisallowElementNS('http://www.w3.org/2000/svg', 'svg') disallows diff --git a/tests/Configurator/TemplateChecks/DisallowElementTest.php b/tests/Configurator/TemplateChecks/DisallowElementTest.php index 9ef36499e6..3e928a1b03 100644 --- a/tests/Configurator/TemplateChecks/DisallowElementTest.php +++ b/tests/Configurator/TemplateChecks/DisallowElementTest.php @@ -10,7 +10,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowElement */ -class DisallowElementTest extends AbstractTemplateCheckTest +class DisallowElementTest extends AbstractTemplateCheckTestClass { /** * @testdox DisallowElement('script') disallows diff --git a/tests/Configurator/TemplateChecks/DisallowUnsafeDynamicURLTest.php b/tests/Configurator/TemplateChecks/DisallowUnsafeDynamicURLTest.php index ed5ca4938e..b70fd07da7 100644 --- a/tests/Configurator/TemplateChecks/DisallowUnsafeDynamicURLTest.php +++ b/tests/Configurator/TemplateChecks/DisallowUnsafeDynamicURLTest.php @@ -11,7 +11,7 @@ * @covers s9e\TextFormatter\Configurator\TemplateChecks\AbstractDynamicContentCheck * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowUnsafeDynamicURL */ -class DisallowUnsafeDynamicURLTest extends AbstractTemplateCheckTest +class DisallowUnsafeDynamicURLTest extends AbstractTemplateCheckTestClass { /** * @testdox Allowed: ... diff --git a/tests/Configurator/TemplateChecks/DisallowUnsupportedXSLTest.php b/tests/Configurator/TemplateChecks/DisallowUnsupportedXSLTest.php index 7663ade99f..cc21020ef8 100644 --- a/tests/Configurator/TemplateChecks/DisallowUnsupportedXSLTest.php +++ b/tests/Configurator/TemplateChecks/DisallowUnsupportedXSLTest.php @@ -10,7 +10,7 @@ * @covers s9e\TextFormatter\Configurator\TemplateChecks\AbstractXSLSupportCheck * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowUnsupportedXSL */ -class DisallowUnsupportedXSLTest extends AbstractTemplateCheckTest +class DisallowUnsupportedXSLTest extends AbstractTemplateCheckTestClass { /** * @testdox Allowed: ... diff --git a/tests/Configurator/TemplateChecks/DisallowXPathFunctionTest.php b/tests/Configurator/TemplateChecks/DisallowXPathFunctionTest.php index 56df25c127..e232d0b09d 100644 --- a/tests/Configurator/TemplateChecks/DisallowXPathFunctionTest.php +++ b/tests/Configurator/TemplateChecks/DisallowXPathFunctionTest.php @@ -9,7 +9,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateChecks\DisallowXPathFunction */ -class DisallowXPathFunctionTest extends AbstractTemplateCheckTest +class DisallowXPathFunctionTest extends AbstractTemplateCheckTestClass { /** * @testdox Disallowed: diff --git a/tests/Configurator/TemplateChecks/RestrictFlashNetworkingTest.php b/tests/Configurator/TemplateChecks/RestrictFlashNetworkingTest.php index 00e3247cdb..0d4740eae5 100644 --- a/tests/Configurator/TemplateChecks/RestrictFlashNetworkingTest.php +++ b/tests/Configurator/TemplateChecks/RestrictFlashNetworkingTest.php @@ -10,7 +10,7 @@ * @covers s9e\TextFormatter\Configurator\TemplateChecks\AbstractFlashRestriction * @covers s9e\TextFormatter\Configurator\TemplateChecks\RestrictFlashNetworking */ -class RestrictFlashNetworkingTest extends AbstractTemplateCheckTest +class RestrictFlashNetworkingTest extends AbstractTemplateCheckTestClass { /** * @testdox 'internal' disallows diff --git a/tests/Configurator/TemplateChecks/RestrictFlashScriptAccessTest.php b/tests/Configurator/TemplateChecks/RestrictFlashScriptAccessTest.php index 1ab4780403..4810ba83be 100644 --- a/tests/Configurator/TemplateChecks/RestrictFlashScriptAccessTest.php +++ b/tests/Configurator/TemplateChecks/RestrictFlashScriptAccessTest.php @@ -10,7 +10,7 @@ * @covers s9e\TextFormatter\Configurator\TemplateChecks\AbstractFlashRestriction * @covers s9e\TextFormatter\Configurator\TemplateChecks\RestrictFlashScriptAccess */ -class RestrictFlashScriptAccessTest extends AbstractTemplateCheckTest +class RestrictFlashScriptAccessTest extends AbstractTemplateCheckTestClass { /** * @testdox 'sameDomain' disallows diff --git a/tests/Configurator/TemplateNormalizations/AbstractNormalizationTest.php b/tests/Configurator/TemplateNormalizations/AbstractNormalizationTestClass.php similarity index 97% rename from tests/Configurator/TemplateNormalizations/AbstractNormalizationTest.php rename to tests/Configurator/TemplateNormalizations/AbstractNormalizationTestClass.php index a3088ee5ba..757179f64d 100644 --- a/tests/Configurator/TemplateNormalizations/AbstractNormalizationTest.php +++ b/tests/Configurator/TemplateNormalizations/AbstractNormalizationTestClass.php @@ -10,7 +10,7 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\AbstractNormalization */ -class AbstractNormalizationTest extends Test +class AbstractNormalizationTestClass extends Test { protected function getNormalization($query = null) { @@ -21,7 +21,7 @@ protected function getMockNormalization($query) { return $this->getMockBuilder(__NAMESPACE__ . '\\TestNormalization') ->setConstructorArgs([$this, $query]) - ->setMethods(['normalizeAttribute', 'normalizeElement']) + ->onlyMethods(['normalizeAttribute', 'normalizeElement']) ->getMock(); } diff --git a/tests/Configurator/TemplateNormalizations/AbstractTest.php b/tests/Configurator/TemplateNormalizations/AbstractTestClass.php similarity index 92% rename from tests/Configurator/TemplateNormalizations/AbstractTest.php rename to tests/Configurator/TemplateNormalizations/AbstractTestClass.php index 5384b95876..482d43546c 100644 --- a/tests/Configurator/TemplateNormalizations/AbstractTest.php +++ b/tests/Configurator/TemplateNormalizations/AbstractTestClass.php @@ -8,7 +8,7 @@ use s9e\TextFormatter\Configurator\Helpers\TemplateLoader; use s9e\TextFormatter\Tests\Test; -abstract class AbstractTest extends Test +abstract class AbstractTestClass extends Test { protected function getNormalizer(array $args = []) { @@ -52,5 +52,5 @@ public function test($template, $expected, array $args = []) ); } - abstract public function getData(); + abstract public static function getData(); } \ No newline at end of file diff --git a/tests/Configurator/TemplateNormalizations/AddAttributeValueToElementsTest.php b/tests/Configurator/TemplateNormalizations/AddAttributeValueToElementsTest.php index 22ef5a4697..ac0f7e78f2 100644 --- a/tests/Configurator/TemplateNormalizations/AddAttributeValueToElementsTest.php +++ b/tests/Configurator/TemplateNormalizations/AddAttributeValueToElementsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\AddAttributeValueToElements */ -class AddAttributeValueToElementsTest extends AbstractTest +class AddAttributeValueToElementsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/ConvertCurlyExpressionsInTextTest.php b/tests/Configurator/TemplateNormalizations/ConvertCurlyExpressionsInTextTest.php index d274c33fad..c411181584 100644 --- a/tests/Configurator/TemplateNormalizations/ConvertCurlyExpressionsInTextTest.php +++ b/tests/Configurator/TemplateNormalizations/ConvertCurlyExpressionsInTextTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\ConvertCurlyExpressionsInText */ -class ConvertCurlyExpressionsInTextTest extends AbstractTest +class ConvertCurlyExpressionsInTextTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/CustomTest.php b/tests/Configurator/TemplateNormalizations/CustomTest.php index 8066528de6..636b357cfa 100644 --- a/tests/Configurator/TemplateNormalizations/CustomTest.php +++ b/tests/Configurator/TemplateNormalizations/CustomTest.php @@ -20,7 +20,7 @@ public function testNormalize() $dom->loadXML(''); $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $mock->expects($this->once()) ->method('foo') diff --git a/tests/Configurator/TemplateNormalizations/DeoptimizeIfTest.php b/tests/Configurator/TemplateNormalizations/DeoptimizeIfTest.php index f0af6fac67..1591fdbd47 100644 --- a/tests/Configurator/TemplateNormalizations/DeoptimizeIfTest.php +++ b/tests/Configurator/TemplateNormalizations/DeoptimizeIfTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\DeoptimizeIf */ -class DeoptimizeIfTest extends AbstractTest +class DeoptimizeIfTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/EnforceHTMLOmittedEndTagsTest.php b/tests/Configurator/TemplateNormalizations/EnforceHTMLOmittedEndTagsTest.php index 8a8934d548..b02cf6f06f 100644 --- a/tests/Configurator/TemplateNormalizations/EnforceHTMLOmittedEndTagsTest.php +++ b/tests/Configurator/TemplateNormalizations/EnforceHTMLOmittedEndTagsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\EnforceHTMLOmittedEndTags */ -class EnforceHTMLOmittedEndTagsTest extends AbstractTest +class EnforceHTMLOmittedEndTagsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/FixUnescapedCurlyBracesInHtmlAttributesTest.php b/tests/Configurator/TemplateNormalizations/FixUnescapedCurlyBracesInHtmlAttributesTest.php index 73bb4e8391..b2e72d524b 100644 --- a/tests/Configurator/TemplateNormalizations/FixUnescapedCurlyBracesInHtmlAttributesTest.php +++ b/tests/Configurator/TemplateNormalizations/FixUnescapedCurlyBracesInHtmlAttributesTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\FixUnescapedCurlyBracesInHtmlAttributes */ -class FixUnescapedCurlyBracesInHtmlAttributesTest extends AbstractTest +class FixUnescapedCurlyBracesInHtmlAttributesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/FoldArithmeticConstantsTest.php b/tests/Configurator/TemplateNormalizations/FoldArithmeticConstantsTest.php index 7ceb48030a..089295f942 100644 --- a/tests/Configurator/TemplateNormalizations/FoldArithmeticConstantsTest.php +++ b/tests/Configurator/TemplateNormalizations/FoldArithmeticConstantsTest.php @@ -6,7 +6,7 @@ * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\FoldArithmeticConstants * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\AbstractConstantFolding */ -class FoldArithmeticConstantsTest extends AbstractTest +class FoldArithmeticConstantsTest extends AbstractTestClass { public function tearDown(): void { @@ -29,7 +29,7 @@ public function testLocale() ); } - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/FoldConstantXPathExpressionsTest.php b/tests/Configurator/TemplateNormalizations/FoldConstantXPathExpressionsTest.php index 4618aaf8a4..df65fc86ec 100644 --- a/tests/Configurator/TemplateNormalizations/FoldConstantXPathExpressionsTest.php +++ b/tests/Configurator/TemplateNormalizations/FoldConstantXPathExpressionsTest.php @@ -6,7 +6,7 @@ * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\FoldConstantXPathExpressions * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\AbstractConstantFolding */ -class FoldConstantXPathExpressionsTest extends AbstractTest +class FoldConstantXPathExpressionsTest extends AbstractTestClass { public function tearDown(): void { @@ -29,7 +29,7 @@ public function testLocale() ); } - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/InlineAttributesTest.php b/tests/Configurator/TemplateNormalizations/InlineAttributesTest.php index 6529da8068..d8d9f67f75 100644 --- a/tests/Configurator/TemplateNormalizations/InlineAttributesTest.php +++ b/tests/Configurator/TemplateNormalizations/InlineAttributesTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\InlineAttributes */ -class InlineAttributesTest extends AbstractTest +class InlineAttributesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/InlineCDATATest.php b/tests/Configurator/TemplateNormalizations/InlineCDATATest.php index 26c0163e0f..79c0e71391 100644 --- a/tests/Configurator/TemplateNormalizations/InlineCDATATest.php +++ b/tests/Configurator/TemplateNormalizations/InlineCDATATest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\InlineCDATA */ -class InlineCDATATest extends AbstractTest +class InlineCDATATest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/InlineElementsTest.php b/tests/Configurator/TemplateNormalizations/InlineElementsTest.php index 674cdcb1f2..fbeda7ef3e 100644 --- a/tests/Configurator/TemplateNormalizations/InlineElementsTest.php +++ b/tests/Configurator/TemplateNormalizations/InlineElementsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\InlineElements */ -class InlineElementsTest extends AbstractTest +class InlineElementsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/InlineInferredValuesTest.php b/tests/Configurator/TemplateNormalizations/InlineInferredValuesTest.php index 3ca26f31c8..2027d8ea37 100644 --- a/tests/Configurator/TemplateNormalizations/InlineInferredValuesTest.php +++ b/tests/Configurator/TemplateNormalizations/InlineInferredValuesTest.php @@ -8,9 +8,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\InlineInferredValues */ -class InlineInferredValuesTest extends AbstractTest +class InlineInferredValuesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/InlineTextElementsTest.php b/tests/Configurator/TemplateNormalizations/InlineTextElementsTest.php index 41a31014be..b45534641f 100644 --- a/tests/Configurator/TemplateNormalizations/InlineTextElementsTest.php +++ b/tests/Configurator/TemplateNormalizations/InlineTextElementsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\InlineTextElements */ -class InlineTextElementsTest extends AbstractTest +class InlineTextElementsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/InlineXPathLiteralsTest.php b/tests/Configurator/TemplateNormalizations/InlineXPathLiteralsTest.php index fb216a8686..60829695ea 100644 --- a/tests/Configurator/TemplateNormalizations/InlineXPathLiteralsTest.php +++ b/tests/Configurator/TemplateNormalizations/InlineXPathLiteralsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\InlineXPathLiterals */ -class InlineXPathLiteralsTest extends AbstractTest +class InlineXPathLiteralsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/MergeConsecutiveCopyOfTest.php b/tests/Configurator/TemplateNormalizations/MergeConsecutiveCopyOfTest.php index 4ad761a452..845371ae0f 100644 --- a/tests/Configurator/TemplateNormalizations/MergeConsecutiveCopyOfTest.php +++ b/tests/Configurator/TemplateNormalizations/MergeConsecutiveCopyOfTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\MergeConsecutiveCopyOf */ -class MergeConsecutiveCopyOfTest extends AbstractTest +class MergeConsecutiveCopyOfTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/MergeIdenticalConditionalBranchesTest.php b/tests/Configurator/TemplateNormalizations/MergeIdenticalConditionalBranchesTest.php index 05b1061629..5a24d17b76 100644 --- a/tests/Configurator/TemplateNormalizations/MergeIdenticalConditionalBranchesTest.php +++ b/tests/Configurator/TemplateNormalizations/MergeIdenticalConditionalBranchesTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\MergeIdenticalConditionalBranches */ -class MergeIdenticalConditionalBranchesTest extends AbstractTest +class MergeIdenticalConditionalBranchesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/MinifyInlineCSSTest.php b/tests/Configurator/TemplateNormalizations/MinifyInlineCSSTest.php index 0397689b5e..3fbb80925a 100644 --- a/tests/Configurator/TemplateNormalizations/MinifyInlineCSSTest.php +++ b/tests/Configurator/TemplateNormalizations/MinifyInlineCSSTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\MinifyInlineCSS */ -class MinifyInlineCSSTest extends AbstractTest +class MinifyInlineCSSTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/MinifyXPathExpressionsTest.php b/tests/Configurator/TemplateNormalizations/MinifyXPathExpressionsTest.php index 8b24058adf..406a7b57f2 100644 --- a/tests/Configurator/TemplateNormalizations/MinifyXPathExpressionsTest.php +++ b/tests/Configurator/TemplateNormalizations/MinifyXPathExpressionsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\MinifyXPathExpressions */ -class MinifyXPathExpressionsTest extends AbstractTest +class MinifyXPathExpressionsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/NormalizeAttributeNamesTest.php b/tests/Configurator/TemplateNormalizations/NormalizeAttributeNamesTest.php index 93ee3537fe..1dd53a2ed7 100644 --- a/tests/Configurator/TemplateNormalizations/NormalizeAttributeNamesTest.php +++ b/tests/Configurator/TemplateNormalizations/NormalizeAttributeNamesTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\NormalizeAttributeNames */ -class NormalizeAttributeNamesTest extends AbstractTest +class NormalizeAttributeNamesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/NormalizeElementNamesTest.php b/tests/Configurator/TemplateNormalizations/NormalizeElementNamesTest.php index 329ed674bb..fb46ae9834 100644 --- a/tests/Configurator/TemplateNormalizations/NormalizeElementNamesTest.php +++ b/tests/Configurator/TemplateNormalizations/NormalizeElementNamesTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\NormalizeElementNames */ -class NormalizeElementNamesTest extends AbstractTest +class NormalizeElementNamesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/NormalizeUrlsTest.php b/tests/Configurator/TemplateNormalizations/NormalizeUrlsTest.php index 03eca38dea..0fa2f5788a 100644 --- a/tests/Configurator/TemplateNormalizations/NormalizeUrlsTest.php +++ b/tests/Configurator/TemplateNormalizations/NormalizeUrlsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\NormalizeUrls */ -class NormalizeUrlsTest extends AbstractTest +class NormalizeUrlsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/OptimizeChooseDeadBranchesTest.php b/tests/Configurator/TemplateNormalizations/OptimizeChooseDeadBranchesTest.php index 376df579a3..52d30e0eeb 100644 --- a/tests/Configurator/TemplateNormalizations/OptimizeChooseDeadBranchesTest.php +++ b/tests/Configurator/TemplateNormalizations/OptimizeChooseDeadBranchesTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\AbstractChooseOptimization * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\OptimizeChooseDeadBranches */ -class OptimizeChooseDeadBranchesTest extends AbstractTest +class OptimizeChooseDeadBranchesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/OptimizeChooseTest.php b/tests/Configurator/TemplateNormalizations/OptimizeChooseTest.php index fa28ad4673..fa742c91fc 100644 --- a/tests/Configurator/TemplateNormalizations/OptimizeChooseTest.php +++ b/tests/Configurator/TemplateNormalizations/OptimizeChooseTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\AbstractChooseOptimization * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\OptimizeChoose */ -class OptimizeChooseTest extends AbstractTest +class OptimizeChooseTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/OptimizeChooseTextTest.php b/tests/Configurator/TemplateNormalizations/OptimizeChooseTextTest.php index 85e91cf408..af3e22f142 100644 --- a/tests/Configurator/TemplateNormalizations/OptimizeChooseTextTest.php +++ b/tests/Configurator/TemplateNormalizations/OptimizeChooseTextTest.php @@ -6,9 +6,9 @@ * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\AbstractChooseOptimization * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\OptimizeChooseText */ -class OptimizeChooseTextTest extends AbstractTest +class OptimizeChooseTextTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/OptimizeConditionalAttributesTest.php b/tests/Configurator/TemplateNormalizations/OptimizeConditionalAttributesTest.php index ecab1eee66..6972838615 100644 --- a/tests/Configurator/TemplateNormalizations/OptimizeConditionalAttributesTest.php +++ b/tests/Configurator/TemplateNormalizations/OptimizeConditionalAttributesTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\OptimizeConditionalAttributes */ -class OptimizeConditionalAttributesTest extends AbstractTest +class OptimizeConditionalAttributesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/OptimizeConditionalValueOfTest.php b/tests/Configurator/TemplateNormalizations/OptimizeConditionalValueOfTest.php index 64bd1d637c..6d70795ace 100644 --- a/tests/Configurator/TemplateNormalizations/OptimizeConditionalValueOfTest.php +++ b/tests/Configurator/TemplateNormalizations/OptimizeConditionalValueOfTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\OptimizeConditionalValueOf */ -class OptimizeConditionalValueOfTest extends AbstractTest +class OptimizeConditionalValueOfTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/OptimizeNestedConditionalsTest.php b/tests/Configurator/TemplateNormalizations/OptimizeNestedConditionalsTest.php index 0dbe799800..971c96fd15 100644 --- a/tests/Configurator/TemplateNormalizations/OptimizeNestedConditionalsTest.php +++ b/tests/Configurator/TemplateNormalizations/OptimizeNestedConditionalsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\OptimizeNestedConditionals */ -class OptimizeNestedConditionalsTest extends AbstractTest +class OptimizeNestedConditionalsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/PreserveSingleSpacesTest.php b/tests/Configurator/TemplateNormalizations/PreserveSingleSpacesTest.php index 3bbd46c184..2c4eb09e70 100644 --- a/tests/Configurator/TemplateNormalizations/PreserveSingleSpacesTest.php +++ b/tests/Configurator/TemplateNormalizations/PreserveSingleSpacesTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\PreserveSingleSpaces */ -class PreserveSingleSpacesTest extends AbstractTest +class PreserveSingleSpacesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/RemoveCommentsTest.php b/tests/Configurator/TemplateNormalizations/RemoveCommentsTest.php index 794245b27b..c0f1b5395b 100644 --- a/tests/Configurator/TemplateNormalizations/RemoveCommentsTest.php +++ b/tests/Configurator/TemplateNormalizations/RemoveCommentsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\RemoveComments */ -class RemoveCommentsTest extends AbstractTest +class RemoveCommentsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/RemoveInterElementWhitespaceTest.php b/tests/Configurator/TemplateNormalizations/RemoveInterElementWhitespaceTest.php index fca0aa3b41..1689c5e7fc 100644 --- a/tests/Configurator/TemplateNormalizations/RemoveInterElementWhitespaceTest.php +++ b/tests/Configurator/TemplateNormalizations/RemoveInterElementWhitespaceTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\RemoveInterElementWhitespace */ -class RemoveInterElementWhitespaceTest extends AbstractTest +class RemoveInterElementWhitespaceTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/RemoveLivePreviewAttributesTest.php b/tests/Configurator/TemplateNormalizations/RemoveLivePreviewAttributesTest.php index d90ee52ea3..84e1a6ddbe 100644 --- a/tests/Configurator/TemplateNormalizations/RemoveLivePreviewAttributesTest.php +++ b/tests/Configurator/TemplateNormalizations/RemoveLivePreviewAttributesTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\RemoveLivePreviewAttributes */ -class RemoveLivePreviewAttributesTest extends AbstractTest +class RemoveLivePreviewAttributesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/RenameLivePreviewEventTest.php b/tests/Configurator/TemplateNormalizations/RenameLivePreviewEventTest.php index 3dc6f107e7..45badd673d 100644 --- a/tests/Configurator/TemplateNormalizations/RenameLivePreviewEventTest.php +++ b/tests/Configurator/TemplateNormalizations/RenameLivePreviewEventTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\RenameLivePreviewEvent */ -class RenameLivePreviewEventTest extends AbstractTest +class RenameLivePreviewEventTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/SetAttributeOnElementsTest.php b/tests/Configurator/TemplateNormalizations/SetAttributeOnElementsTest.php index 396107a85b..b5357a259f 100644 --- a/tests/Configurator/TemplateNormalizations/SetAttributeOnElementsTest.php +++ b/tests/Configurator/TemplateNormalizations/SetAttributeOnElementsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\SetAttributeOnElements */ -class SetAttributeOnElementsTest extends AbstractTest +class SetAttributeOnElementsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/SetRelNoreferrerOnTargetedLinksTest.php b/tests/Configurator/TemplateNormalizations/SetRelNoreferrerOnTargetedLinksTest.php index 366bc653e1..fc3d40c07c 100644 --- a/tests/Configurator/TemplateNormalizations/SetRelNoreferrerOnTargetedLinksTest.php +++ b/tests/Configurator/TemplateNormalizations/SetRelNoreferrerOnTargetedLinksTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\SetRelNoreferrerOnTargetedLinks */ -class SetRelNoreferrerOnTargetedLinksTest extends AbstractTest +class SetRelNoreferrerOnTargetedLinksTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/SortAttributesByNameTest.php b/tests/Configurator/TemplateNormalizations/SortAttributesByNameTest.php index 58a5a62f12..e525c828a1 100644 --- a/tests/Configurator/TemplateNormalizations/SortAttributesByNameTest.php +++ b/tests/Configurator/TemplateNormalizations/SortAttributesByNameTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\SortAttributesByName */ -class SortAttributesByNameTest extends AbstractTest +class SortAttributesByNameTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/TransposeCommentsTest.php b/tests/Configurator/TemplateNormalizations/TransposeCommentsTest.php index 4e76175713..a7cfaf48c5 100644 --- a/tests/Configurator/TemplateNormalizations/TransposeCommentsTest.php +++ b/tests/Configurator/TemplateNormalizations/TransposeCommentsTest.php @@ -5,9 +5,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\TransposeComments */ -class TransposeCommentsTest extends AbstractTest +class TransposeCommentsTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizations/UninlineAttributesTest.php b/tests/Configurator/TemplateNormalizations/UninlineAttributesTest.php index 9451f40097..9d3863b20b 100644 --- a/tests/Configurator/TemplateNormalizations/UninlineAttributesTest.php +++ b/tests/Configurator/TemplateNormalizations/UninlineAttributesTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Configurator\TemplateNormalizations\UninlineAttributes */ -class UninlineAttributesTest extends AbstractTest +class UninlineAttributesTest extends AbstractTestClass { - public function getData() + public static function getData() { return [ [ diff --git a/tests/Configurator/TemplateNormalizerTest.php b/tests/Configurator/TemplateNormalizerTest.php index 69823012d0..04ac23c218 100644 --- a/tests/Configurator/TemplateNormalizerTest.php +++ b/tests/Configurator/TemplateNormalizerTest.php @@ -58,7 +58,7 @@ public function testNormalizeTag() $mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\Items\\Template') ->disableOriginalConstructor() - ->setMethods(['__toString', 'isNormalized', 'normalize']) + ->onlyMethods(['__toString', 'isNormalized', 'normalize']) ->getMock(); $mock->expects($this->any()) @@ -118,7 +118,7 @@ public function testDefault($template, $expected) $this->assertSame($expected, $templateNormalizer->normalizeTemplate($template)); } - public function getDefault() + public static function getDefault() { return [ [ diff --git a/tests/Parser/AttributeFilters/AbstractFilterTest.php b/tests/Parser/AttributeFilters/AbstractFilterTestClass.php similarity index 94% rename from tests/Parser/AttributeFilters/AbstractFilterTest.php rename to tests/Parser/AttributeFilters/AbstractFilterTestClass.php index a3f50a08cc..2ee94a2783 100644 --- a/tests/Parser/AttributeFilters/AbstractFilterTest.php +++ b/tests/Parser/AttributeFilters/AbstractFilterTestClass.php @@ -4,9 +4,9 @@ use s9e\TextFormatter\Tests\Test; -abstract class AbstractFilterTest extends Test +abstract class AbstractFilterTestClass extends Test { - abstract public function getFilterTests(); + abstract public static function getFilterTests(); /** * @dataProvider getFilterTests diff --git a/tests/Parser/AttributeFilters/AlnumFilterTest.php b/tests/Parser/AttributeFilters/AlnumFilterTest.php index 420e68bb0a..911df894a7 100644 --- a/tests/Parser/AttributeFilters/AlnumFilterTest.php +++ b/tests/Parser/AttributeFilters/AlnumFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\RegexpFilter */ -class AlnumFilterTest extends AbstractFilterTest +class AlnumFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new AlnumFilter, '', false], diff --git a/tests/Parser/AttributeFilters/ColorFilterTest.php b/tests/Parser/AttributeFilters/ColorFilterTest.php index 2fb5e80170..2a4555a4b9 100644 --- a/tests/Parser/AttributeFilters/ColorFilterTest.php +++ b/tests/Parser/AttributeFilters/ColorFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\RegexpFilter */ -class ColorFilterTest extends AbstractFilterTest +class ColorFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new ColorFilter, '#123abc', '#123abc'], diff --git a/tests/Parser/AttributeFilters/EmailFilterTest.php b/tests/Parser/AttributeFilters/EmailFilterTest.php index 4480ef16f9..0c79ca7aea 100644 --- a/tests/Parser/AttributeFilters/EmailFilterTest.php +++ b/tests/Parser/AttributeFilters/EmailFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\EmailFilter */ -class EmailFilterTest extends AbstractFilterTest +class EmailFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new EmailFilter, 'example@example.com', 'example@example.com'], diff --git a/tests/Parser/AttributeFilters/FalseFilterTest.php b/tests/Parser/AttributeFilters/FalseFilterTest.php index fff057dfa2..9cf58f5088 100644 --- a/tests/Parser/AttributeFilters/FalseFilterTest.php +++ b/tests/Parser/AttributeFilters/FalseFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\FalseFilter */ -class FalseFilterTest extends AbstractFilterTest +class FalseFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new FalseFilter, 'bar', false], diff --git a/tests/Parser/AttributeFilters/FontfamilyFilterTest.php b/tests/Parser/AttributeFilters/FontfamilyFilterTest.php index 3e648b0026..8ded03974a 100644 --- a/tests/Parser/AttributeFilters/FontfamilyFilterTest.php +++ b/tests/Parser/AttributeFilters/FontfamilyFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\RegexpFilter */ -class FontfamilyFilterTest extends AbstractFilterTest +class FontfamilyFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new FontfamilyFilter, 'Arial', 'Arial'], diff --git a/tests/Parser/AttributeFilters/HashmapFilterTest.php b/tests/Parser/AttributeFilters/HashmapFilterTest.php index 9d1f520d5c..7045606634 100644 --- a/tests/Parser/AttributeFilters/HashmapFilterTest.php +++ b/tests/Parser/AttributeFilters/HashmapFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\HashmapFilter */ -class HashmapFilterTest extends AbstractFilterTest +class HashmapFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new HashmapFilter(['foo' => 'bar']), 'foo', 'bar'], diff --git a/tests/Parser/AttributeFilters/IdentifierFilterTest.php b/tests/Parser/AttributeFilters/IdentifierFilterTest.php index 3c6cb25ccc..527cb0ecf5 100644 --- a/tests/Parser/AttributeFilters/IdentifierFilterTest.php +++ b/tests/Parser/AttributeFilters/IdentifierFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\RegexpFilter */ -class IdentifierFilterTest extends AbstractFilterTest +class IdentifierFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new IdentifierFilter, '123abcABC', '123abcABC'], diff --git a/tests/Parser/AttributeFilters/MapFilterTest.php b/tests/Parser/AttributeFilters/MapFilterTest.php index cc076cad9a..c64a02e24a 100644 --- a/tests/Parser/AttributeFilters/MapFilterTest.php +++ b/tests/Parser/AttributeFilters/MapFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\MapFilter */ -class MapFilterTest extends AbstractFilterTest +class MapFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new MapFilter(['uno' => 'one', 'dos' => 'two']), 'dos', 'two'], diff --git a/tests/Parser/AttributeFilters/NetworkFilterTest.php b/tests/Parser/AttributeFilters/NetworkFilterTest.php index 3fcba2709d..ba7e78a1dd 100644 --- a/tests/Parser/AttributeFilters/NetworkFilterTest.php +++ b/tests/Parser/AttributeFilters/NetworkFilterTest.php @@ -10,9 +10,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\NetworkFilter */ -class NetworkFilterTest extends AbstractFilterTest +class NetworkFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new IpFilter, '8.8.8.8', '8.8.8.8'], diff --git a/tests/Parser/AttributeFilters/NumericFilterTest.php b/tests/Parser/AttributeFilters/NumericFilterTest.php index 1b6f3faecf..67c8a1d269 100644 --- a/tests/Parser/AttributeFilters/NumericFilterTest.php +++ b/tests/Parser/AttributeFilters/NumericFilterTest.php @@ -11,7 +11,7 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\NumericFilter */ -class NumericFilterTest extends AbstractFilterTest +class NumericFilterTest extends AbstractFilterTestClass { /** * @dataProvider getRegressionsData @@ -30,7 +30,7 @@ public function testRegressions($original, array $results) * NOTE: this test is not normative. Some cases exist solely to track regressions or changes in * behaviour in ext/filter */ - public function getRegressionsData() + public static function getRegressionsData() { return [ ['123', ['int' => 123, 'uint' => 123, 'float' => 123.0]], @@ -47,7 +47,7 @@ public function getRegressionsData() ]; } - public function getFilterTests() + public static function getFilterTests() { return [ [new FloatFilter, '123', 123 ], diff --git a/tests/Parser/AttributeFilters/RangeFilterTest.php b/tests/Parser/AttributeFilters/RangeFilterTest.php index ebda0d8aed..d09c5672e7 100644 --- a/tests/Parser/AttributeFilters/RangeFilterTest.php +++ b/tests/Parser/AttributeFilters/RangeFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\NumericFilter */ -class RangeFilterTest extends AbstractFilterTest +class RangeFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new RangeFilter(2, 5), '2', 2], diff --git a/tests/Parser/AttributeFilters/RegexpFilterTest.php b/tests/Parser/AttributeFilters/RegexpFilterTest.php index da1b18bf91..4966934a2d 100644 --- a/tests/Parser/AttributeFilters/RegexpFilterTest.php +++ b/tests/Parser/AttributeFilters/RegexpFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\RegexpFilter */ -class RegexpFilterTest extends AbstractFilterTest +class RegexpFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new RegexpFilter('/^[A-Z]+$/D'), 'ABC', 'ABC'], diff --git a/tests/Parser/AttributeFilters/SimpletextFilterTest.php b/tests/Parser/AttributeFilters/SimpletextFilterTest.php index 5bf606c6c2..d65f3df76f 100644 --- a/tests/Parser/AttributeFilters/SimpletextFilterTest.php +++ b/tests/Parser/AttributeFilters/SimpletextFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\RegexpFilter */ -class SimpletextFilterTest extends AbstractFilterTest +class SimpletextFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [ diff --git a/tests/Parser/AttributeFilters/TimestampFilterTest.php b/tests/Parser/AttributeFilters/TimestampFilterTest.php index 0219e843be..e663415ffe 100644 --- a/tests/Parser/AttributeFilters/TimestampFilterTest.php +++ b/tests/Parser/AttributeFilters/TimestampFilterTest.php @@ -7,9 +7,9 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\TimestampFilter */ -class TimestampFilterTest extends AbstractFilterTest +class TimestampFilterTest extends AbstractFilterTestClass { - public function getFilterTests() + public static function getFilterTests() { return [ [new TimestampFilter, '123', 123], diff --git a/tests/Parser/AttributeFilters/UrlFilterTest.php b/tests/Parser/AttributeFilters/UrlFilterTest.php index e532be7bd3..94fcd84341 100644 --- a/tests/Parser/AttributeFilters/UrlFilterTest.php +++ b/tests/Parser/AttributeFilters/UrlFilterTest.php @@ -8,7 +8,7 @@ /** * @covers s9e\TextFormatter\Parser\AttributeFilters\UrlFilter */ -class UrlFilterTest extends AbstractFilterTest +class UrlFilterTest extends AbstractFilterTestClass { /** * @testdox filterUrl() can be called without a logger @@ -41,7 +41,7 @@ public function testSanitizeUrl($url, $expected) $this->assertSame($expected, FilterClass::sanitizeUrl($url)); } - public function getSanitizeUrlTests() + public static function getSanitizeUrlTests() { return [ [ @@ -115,7 +115,7 @@ public function getSanitizeUrlTests() ]; } - public function getFilterTests() + public static function getFilterTests() { return [ [ diff --git a/tests/Parser/FilterProcessingTest.php b/tests/Parser/FilterProcessingTest.php index 02f14c019e..c220fa4192 100644 --- a/tests/Parser/FilterProcessingTest.php +++ b/tests/Parser/FilterProcessingTest.php @@ -122,7 +122,7 @@ public function testExecuteAttributePreprocessorsEmpty() { $tag = $this->getMockBuilder('s9e\\TextFormatter\\Parser\\Tag') ->disableOriginalConstructor() - ->setMethods(['hasAttribute']) + ->onlyMethods(['hasAttribute']) ->getMock(); $tag->expects($this->never())->method('hasAttribute'); @@ -225,7 +225,7 @@ function() public function testFilterTag() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo', 'bar']) + ->addMethods(['foo', 'bar']) ->getMock(); $mock->expects($this->once())->method('foo'); $mock->expects($this->once())->method('bar'); @@ -250,7 +250,7 @@ public function testFilterTagStopsExecution() { $tag = $this->configurator->tags->add('X'); $mock = $this->getMockBuilder('stdClass') - ->setMethods(['bar']) + ->addMethods(['bar']) ->getMock(); $mock->expects($this->never())->method('bar'); @@ -272,7 +272,7 @@ public function testFilterTagStopsExecution() public function testFilterTagCallsLoggerSetTag() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $mock->expects($this->once())->method('foo'); @@ -284,7 +284,7 @@ public function testFilterTagCallsLoggerSetTag() $tag = new Tag(Tag::SELF_CLOSING_TAG, 'X', 0, 0); $logger = $this->getMockBuilder('s9e\\TextFormatter\\Parser\\Logger') - ->setMethods(['setTag', 'unsetTag']) + ->onlyMethods(['setTag', 'unsetTag']) ->getMock(); $logger->expects($this->once()) ->method('setTag') @@ -294,7 +294,7 @@ public function testFilterTagCallsLoggerSetTag() $parser = $this->getMockBuilder('s9e\\TextFormatter\\Parser') ->disableOriginalConstructor() - ->setMethods(['getLogger', 'getText']) + ->onlyMethods(['getLogger', 'getText']) ->getMock(); $parser->expects($this->once())->method('getLogger')->will($this->returnValue($logger)); $parser->expects($this->any())->method('getText')->will($this->returnValue('')); @@ -308,7 +308,7 @@ public function testFilterTagCallsLoggerSetTag() public function testFilterTagPassesParser() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $tag = $this->configurator->tags->add('X'); @@ -336,11 +336,10 @@ public function testFilterTagPassesParser() public function testFilterTagPassesOpenTags() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $mock->expects($this->exactly(2)) ->method('foo') - ->withConsecutive([[]], [[new Tag(Tag::START_TAG, 'X', 0, 0)]]) ->willReturn(true); $this->configurator->rulesGenerator->clear(); @@ -371,7 +370,7 @@ function () use ($parser) public function testFilterTagPassesText() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $mock->expects($this->once()) ->method('foo') @@ -400,7 +399,7 @@ function () use ($parser) public function testFilterTagPassesComputedValues() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $mock->expects($this->once()) ->method('foo') @@ -467,7 +466,7 @@ public function testFilterAttributesRemovesUndefinedAttributes() public function testFilterAttributesExecutesFilterChain() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo', 'bar']) + ->addMethods(['foo', 'bar']) ->getMock(); $mock->expects($this->once()) ->method('foo') @@ -500,7 +499,7 @@ public function testFilterAttributesExecutesFilterChain() public function testFilterAttributesReturnsFalse() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo', 'bar']) + ->addMethods(['foo', 'bar']) ->getMock(); $mock->expects($this->once()) ->method('foo') @@ -527,7 +526,7 @@ public function testFilterAttributesReturnsFalse() public function testFilterAttributesRemovesInvalid() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $mock->expects($this->once()) ->method('foo') @@ -555,7 +554,7 @@ public function testFilterAttributesRemovesInvalid() public function testFilterAttributesReplacesInvalid() { $mock = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $mock->expects($this->once()) ->method('foo') @@ -603,11 +602,10 @@ public function testFilterAttributesReplacesMissing() public function testFilterAttributesCallsLoggerSetAttribute() { $logger = $this->getMockBuilder('s9e\\TextFormatter\\Parser\\Logger') - ->setMethods(['setAttribute', 'unsetAttribute']) + ->onlyMethods(['setAttribute', 'unsetAttribute']) ->getMock(); $logger->expects($this->exactly(2)) - ->method('setAttribute') - ->withConsecutive(['bar'], ['foo']); + ->method('setAttribute'); $logger->expects($this->exactly(2)) ->method('unsetAttribute'); diff --git a/tests/Parser/FunctionalTest.php b/tests/Parser/FunctionalTest.php index 4eb51bf0c2..52f1f95490 100644 --- a/tests/Parser/FunctionalTest.php +++ b/tests/Parser/FunctionalTest.php @@ -37,7 +37,7 @@ public function testFunctionalJavaScript($original, $expected, $setup) $this->runFunctionalTest('assertJSParsing', $original, $expected, $setup); } - public function getFunctionalTests() + public static function getFunctionalTests() { return [ [ diff --git a/tests/Parser/OutputHandlingTest.php b/tests/Parser/OutputHandlingTest.php index 8722dedc4e..9cb3e47054 100644 --- a/tests/Parser/OutputHandlingTest.php +++ b/tests/Parser/OutputHandlingTest.php @@ -21,7 +21,7 @@ public function test($original, $expected, $setup = null, $callback = null) $this->assertParsing($original, $expected, $setup, $callback); } - public function getData() + public static function getData() { return [ [ diff --git a/tests/Parser/PluginsHandlingTest.php b/tests/Parser/PluginsHandlingTest.php index 88d6beb855..d9158d821e 100644 --- a/tests/Parser/PluginsHandlingTest.php +++ b/tests/Parser/PluginsHandlingTest.php @@ -80,7 +80,7 @@ public function testEnableInexistentPlugin() protected function getMockPlugin(Parser $parser) { return $this->getMockBuilder('s9e\\TextFormatter\\Plugins\\ParserBase') - ->setMethods(['parse']) + ->onlyMethods(['parse']) ->setConstructorArgs([$parser, []]) ->getMock(); } @@ -255,7 +255,7 @@ public function testRegisterParserExisting() { $dummy = new PluginsHandlingDummy; $parser = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $parser->expects($this->once()) ->method('foo'); @@ -274,7 +274,7 @@ public function testRegisterParserNew() $dummy->pluginsConfig = []; $parser = $this->getMockBuilder('stdClass') - ->setMethods(['foo']) + ->addMethods(['foo']) ->getMock(); $parser->expects($this->once()) ->method('foo'); diff --git a/tests/Parser/RulesHandlingTest.php b/tests/Parser/RulesHandlingTest.php index dcdfc72fe0..172ae4457d 100644 --- a/tests/Parser/RulesHandlingTest.php +++ b/tests/Parser/RulesHandlingTest.php @@ -21,7 +21,7 @@ public function test($original, $expected, $setup = null, $callback = null) $this->assertParsing($original, $expected, $setup, $callback); } - public function getData() + public static function getData() { return [ [ diff --git a/tests/Parser/TagProcessingTest.php b/tests/Parser/TagProcessingTest.php index 0ccc50842b..b244df977d 100644 --- a/tests/Parser/TagProcessingTest.php +++ b/tests/Parser/TagProcessingTest.php @@ -26,7 +26,7 @@ public function test($original, $expected, $setup = null, $callback = null, arra $this->assertParsing($original, $expected, $setup, $callback, $expectedLogs); } - public function getData() + public static function getData() { return [ [ @@ -335,7 +335,7 @@ function ($parser) 'err', 'Nesting limit exceeded', [ - 'tag' => $this->runClosure( + 'tag' => ( function () { $tag = new Tag(Tag::SELF_CLOSING_TAG, 'X', 2, 1); @@ -343,7 +343,7 @@ function () return $tag; } - ), + )(), 'tagName' => 'X', 'nestingLimit' => 2 ] @@ -368,7 +368,7 @@ function ($parser) 'err', 'Tag limit exceeded', [ - 'tag' => $this->runClosure( + 'tag' => ( function () { $tag = new Tag(Tag::SELF_CLOSING_TAG, 'X', 2, 1); @@ -376,7 +376,7 @@ function () return $tag; } - ), + )(), 'tagName' => 'X', 'tagLimit' => 2 ] @@ -990,7 +990,7 @@ function ($parser) 'Tag is not allowed in this context', [ 'tagName' => 'Y', - 'tag' => $this->runClosure( + 'tag' => ( function () { $tag = new Tag(Tag::SELF_CLOSING_TAG, 'Y', 1, 1); @@ -998,7 +998,7 @@ function () return $tag; } - ), + )(), ] ] ] @@ -1023,7 +1023,7 @@ function ($parser) 'Tag is not allowed in this context', [ 'tagName' => 'Y', - 'tag' => $this->runClosure( + 'tag' => ( function () { $tag = new Tag(Tag::SELF_CLOSING_TAG, 'Y', 1, 0); @@ -1031,7 +1031,7 @@ function () return $tag; } - ), + )(), ] ] ] @@ -1454,7 +1454,7 @@ public function testJS($original, $expected, $setup) $this->assertJSParsing($original, $expected); } - public function getJSData() + public static function getJSData() { return [ [ diff --git a/tests/Parser/TagTest.php b/tests/Parser/TagTest.php index 5770c12f42..e63e1c9d46 100644 --- a/tests/Parser/TagTest.php +++ b/tests/Parser/TagTest.php @@ -298,7 +298,7 @@ public function testInvalidateCascade() { $tag1 = new Tag(Tag::START_TAG, 'X', 0, 0); $tag2 = $this->getMockBuilder('s9e\\TextFormatter\\Parser\\Tag') - ->setMethods(['invalidate']) + ->onlyMethods(['invalidate']) ->setConstructorArgs([Tag::START_TAG, 'X', 0, 0]) ->getMock(); $tag2->expects($this->once()) @@ -314,7 +314,7 @@ public function testInvalidateCascade() public function testInvalidateCascadeNotReciprocal() { $tag1 = $this->getMockBuilder('s9e\\TextFormatter\\Parser\\Tag') - ->setMethods(['invalidate']) + ->onlyMethods(['invalidate']) ->setConstructorArgs([Tag::START_TAG, 'X', 0, 0]) ->getMock(); $tag1->expects($this->never()) @@ -332,7 +332,7 @@ public function testInvalidateCascadeImmediate() { $tag1 = new Tag(Tag::START_TAG, 'X', 0, 0); $tag2 = $this->getMockBuilder('s9e\\TextFormatter\\Parser\\Tag') - ->setMethods(['invalidate']) + ->onlyMethods(['invalidate']) ->setConstructorArgs([Tag::START_TAG, 'X', 0, 0]) ->getMock(); $tag2->expects($this->once()) diff --git a/tests/Plugins/Autoemail/ParserTest.php b/tests/Plugins/Autoemail/ParserTest.php index 3171d1cc3c..51273f4273 100644 --- a/tests/Plugins/Autoemail/ParserTest.php +++ b/tests/Plugins/Autoemail/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -46,7 +46,7 @@ public function getParsingTests() ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/Autoimage/ParserTest.php b/tests/Plugins/Autoimage/ParserTest.php index 2a40c2331c..d9ef4015ff 100644 --- a/tests/Plugins/Autoimage/ParserTest.php +++ b/tests/Plugins/Autoimage/ParserTest.php @@ -19,7 +19,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -68,7 +68,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/Autolink/ParserTest.php b/tests/Plugins/Autolink/ParserTest.php index 7b80e184d8..64d210a7b2 100644 --- a/tests/Plugins/Autolink/ParserTest.php +++ b/tests/Plugins/Autolink/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -242,7 +242,7 @@ public static function addContentTag($tag, $parser) $parser->addSelfClosingTag('X', $tagPos, $tagLen, $tag->getSortPriority()); } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/Autovideo/ParserTest.php b/tests/Plugins/Autovideo/ParserTest.php index c68e2c4640..a10b469d11 100644 --- a/tests/Plugins/Autovideo/ParserTest.php +++ b/tests/Plugins/Autovideo/ParserTest.php @@ -19,7 +19,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -68,7 +68,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/BBCodes/BBCodesTest.php b/tests/Plugins/BBCodes/BBCodesTest.php index 9a19a846e7..f137af6567 100644 --- a/tests/Plugins/BBCodes/BBCodesTest.php +++ b/tests/Plugins/BBCodes/BBCodesTest.php @@ -27,7 +27,7 @@ function ($configurator) use ($usage) ); } - public function getExamplesTests() + public static function getExamplesTests() { return [ [ @@ -117,7 +117,7 @@ public function testJS($original, $expected, $setup = null) $this->assertJSParsing($original, $this->getParser()->parse($original)); } - public function getPredefinedBBCodesTests() + public static function getPredefinedBBCodesTests() { return [ [ diff --git a/tests/Plugins/BBCodes/Configurator/BBCodeMonkeyTest.php b/tests/Plugins/BBCodes/Configurator/BBCodeMonkeyTest.php index bbefc964f7..1c2725e6fb 100644 --- a/tests/Plugins/BBCodes/Configurator/BBCodeMonkeyTest.php +++ b/tests/Plugins/BBCodes/Configurator/BBCodeMonkeyTest.php @@ -100,7 +100,7 @@ public function testCreate($usage, $template, $expected) } } - public function getCreateTests() + public static function getCreateTests() { return [ [ diff --git a/tests/Plugins/BBCodes/ParserTest.php b/tests/Plugins/BBCodes/ParserTest.php index dde50517c0..f8c477975c 100644 --- a/tests/Plugins/BBCodes/ParserTest.php +++ b/tests/Plugins/BBCodes/ParserTest.php @@ -16,7 +16,7 @@ class ParserTest extends Test use ParsingTestsRunner; use ParsingTestsJavaScriptRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ diff --git a/tests/Plugins/Censor/ParserTest.php b/tests/Plugins/Censor/ParserTest.php index fac260eb9e..9847a7a008 100644 --- a/tests/Plugins/Censor/ParserTest.php +++ b/tests/Plugins/Censor/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -196,7 +196,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/Emoji/ParserTest.php b/tests/Plugins/Emoji/ParserTest.php index 424bd29d45..9a8bbdfa22 100644 --- a/tests/Plugins/Emoji/ParserTest.php +++ b/tests/Plugins/Emoji/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -174,7 +174,7 @@ function ($configurator, $plugin) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/Emoticons/ParserTest.php b/tests/Plugins/Emoticons/ParserTest.php index cd2bc02e5a..d463198d1b 100644 --- a/tests/Plugins/Emoticons/ParserTest.php +++ b/tests/Plugins/Emoticons/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -72,7 +72,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/Escaper/ParserTest.php b/tests/Plugins/Escaper/ParserTest.php index a6a18c6630..51c1228606 100644 --- a/tests/Plugins/Escaper/ParserTest.php +++ b/tests/Plugins/Escaper/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -60,7 +60,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/FancyPants/ParserTest.php b/tests/Plugins/FancyPants/ParserTest.php index 266012000e..64f8b6a308 100644 --- a/tests/Plugins/FancyPants/ParserTest.php +++ b/tests/Plugins/FancyPants/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -240,7 +240,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/HTMLComments/ParserTest.php b/tests/Plugins/HTMLComments/ParserTest.php index 1a2e417223..6c49b4dd86 100644 --- a/tests/Plugins/HTMLComments/ParserTest.php +++ b/tests/Plugins/HTMLComments/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -66,7 +66,7 @@ public function getParsingTests() ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/HTMLElements/ParserTest.php b/tests/Plugins/HTMLElements/ParserTest.php index e198a2fb2f..43ee18150b 100644 --- a/tests/Plugins/HTMLElements/ParserTest.php +++ b/tests/Plugins/HTMLElements/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -189,7 +189,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/HTMLEntities/ParserTest.php b/tests/Plugins/HTMLEntities/ParserTest.php index 4da1a138b7..75d7941554 100644 --- a/tests/Plugins/HTMLEntities/ParserTest.php +++ b/tests/Plugins/HTMLEntities/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -66,7 +66,7 @@ public function getParsingTests() ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/Keywords/ParserTest.php b/tests/Plugins/Keywords/ParserTest.php index 383d046715..4750643f20 100644 --- a/tests/Plugins/Keywords/ParserTest.php +++ b/tests/Plugins/Keywords/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; // use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/AbstractTest.php b/tests/Plugins/Litedown/Parser/Passes/AbstractTestClass.php similarity index 85% rename from tests/Plugins/Litedown/Parser/Passes/AbstractTest.php rename to tests/Plugins/Litedown/Parser/Passes/AbstractTestClass.php index 667979334b..0905b1268b 100644 --- a/tests/Plugins/Litedown/Parser/Passes/AbstractTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/AbstractTestClass.php @@ -8,14 +8,14 @@ use s9e\TextFormatter\Tests\Plugins\RenderingTestsRunner; use s9e\TextFormatter\Tests\Test; -abstract class AbstractTest extends Test +abstract class AbstractTestClass extends Test { use ParsingTestsRunner; use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - abstract public function getParsingTests(); - abstract public function getRenderingTests(); + abstract public static function getParsingTests(); + abstract public static function getRenderingTests(); protected static function fixTests($tests) { diff --git a/tests/Plugins/Litedown/Parser/Passes/BlocksTest.php b/tests/Plugins/Litedown/Parser/Passes/BlocksTest.php index 5ee0b831e9..6462f3e55d 100644 --- a/tests/Plugins/Litedown/Parser/Passes/BlocksTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/BlocksTest.php @@ -9,9 +9,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Blocks * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Slugger */ -class BlocksTest extends AbstractTest +class BlocksTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -1469,7 +1469,7 @@ function ($configurator) ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/EmphasisTest.php b/tests/Plugins/Litedown/Parser/Passes/EmphasisTest.php index 3c09e9fc88..a542ece24d 100644 --- a/tests/Plugins/Litedown/Parser/Passes/EmphasisTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/EmphasisTest.php @@ -8,9 +8,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\AbstractPass * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Emphasis */ -class EmphasisTest extends AbstractTest +class EmphasisTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -188,7 +188,7 @@ public function getParsingTests() ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/ForcedLineBreaksTest.php b/tests/Plugins/Litedown/Parser/Passes/ForcedLineBreaksTest.php index de8f9725a2..e7223e6694 100644 --- a/tests/Plugins/Litedown/Parser/Passes/ForcedLineBreaksTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/ForcedLineBreaksTest.php @@ -8,9 +8,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\AbstractPass * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\ForcedLineBreaks */ -class ForcedLineBreaksTest extends AbstractTest +class ForcedLineBreaksTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -142,7 +142,7 @@ function ($configurator) ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/ImagesTest.php b/tests/Plugins/Litedown/Parser/Passes/ImagesTest.php index 70af10d9e7..479f06928e 100644 --- a/tests/Plugins/Litedown/Parser/Passes/ImagesTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/ImagesTest.php @@ -9,9 +9,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\AbstractPass * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Images */ -class ImagesTest extends AbstractTest +class ImagesTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -217,7 +217,7 @@ public function getParsingTests() ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/InlineCodeTest.php b/tests/Plugins/Litedown/Parser/Passes/InlineCodeTest.php index 5c2deb7fd7..5c458f1ea4 100644 --- a/tests/Plugins/Litedown/Parser/Passes/InlineCodeTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/InlineCodeTest.php @@ -8,9 +8,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\AbstractPass * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\InlineCode */ -class InlineCodeTest extends AbstractTest +class InlineCodeTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -116,7 +116,7 @@ public function getParsingTests() ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/InlineSpoilerTest.php b/tests/Plugins/Litedown/Parser/Passes/InlineSpoilerTest.php index 98e60cdcae..6ebba31b12 100644 --- a/tests/Plugins/Litedown/Parser/Passes/InlineSpoilerTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/InlineSpoilerTest.php @@ -9,9 +9,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\AbstractPass * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\InlineSpoiler */ -class InlineSpoilerTest extends AbstractTest +class InlineSpoilerTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -61,7 +61,7 @@ public function getParsingTests() ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/LinksTest.php b/tests/Plugins/Litedown/Parser/Passes/LinksTest.php index c1f6b95a73..be08d04b89 100644 --- a/tests/Plugins/Litedown/Parser/Passes/LinksTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/LinksTest.php @@ -9,9 +9,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Links * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\LinkReferences */ -class LinksTest extends AbstractTest +class LinksTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -457,7 +457,7 @@ function ($configurator) ]); } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/StrikethroughTest.php b/tests/Plugins/Litedown/Parser/Passes/StrikethroughTest.php index d094d476dd..daef20a81e 100644 --- a/tests/Plugins/Litedown/Parser/Passes/StrikethroughTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/StrikethroughTest.php @@ -9,9 +9,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\AbstractPass * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Strikethrough */ -class StrikethroughTest extends AbstractTest +class StrikethroughTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -45,7 +45,7 @@ public function getParsingTests() ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/SubscriptTest.php b/tests/Plugins/Litedown/Parser/Passes/SubscriptTest.php index 6f28bcf374..ec6f1dc660 100644 --- a/tests/Plugins/Litedown/Parser/Passes/SubscriptTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/SubscriptTest.php @@ -9,9 +9,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\AbstractScript * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Subscript */ -class SubscriptTest extends AbstractTest +class SubscriptTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -85,7 +85,7 @@ public function getParsingTests() ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/Parser/Passes/SuperscriptTest.php b/tests/Plugins/Litedown/Parser/Passes/SuperscriptTest.php index 2188bdc372..121464906e 100644 --- a/tests/Plugins/Litedown/Parser/Passes/SuperscriptTest.php +++ b/tests/Plugins/Litedown/Parser/Passes/SuperscriptTest.php @@ -9,9 +9,9 @@ * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\AbstractScript * @covers s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Superscript */ -class SuperscriptTest extends AbstractTest +class SuperscriptTest extends AbstractTestClass { - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -81,7 +81,7 @@ public function getParsingTests() ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Litedown/ParserTest.php b/tests/Plugins/Litedown/ParserTest.php index 4a59bffa19..2b2802627c 100644 --- a/tests/Plugins/Litedown/ParserTest.php +++ b/tests/Plugins/Litedown/ParserTest.php @@ -16,7 +16,7 @@ class ParserTest extends Test use ParsingTestsRunner; use ParsingTestsJavaScriptRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ diff --git a/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/AbstractTest.php b/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/AbstractTestClass.php similarity index 85% rename from tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/AbstractTest.php rename to tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/AbstractTestClass.php index 33cd1d2cff..7ca2d216ae 100644 --- a/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/AbstractTest.php +++ b/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/AbstractTestClass.php @@ -4,9 +4,9 @@ use s9e\TextFormatter\Tests\Test; -abstract class AbstractTest extends Test +abstract class AbstractTestClass extends Test { - abstract public function getGetTemplateTests(); + abstract public static function getGetTemplateTests(); abstract protected function getTemplateGenerator(); /** diff --git a/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/ChooseTest.php b/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/ChooseTest.php index d23c8442b7..a89b352616 100644 --- a/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/ChooseTest.php +++ b/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/ChooseTest.php @@ -18,7 +18,7 @@ class ChooseTest extends Test public function testGetTemplateOneWhen() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Plugins\\MediaEmbed\\Configurator\\TemplateBuilder') - ->setMethods(['getTemplate']) + ->onlyMethods(['getTemplate']) ->getMock(); $mock->expects($this->exactly(2)) ->method('getTemplate') @@ -48,7 +48,7 @@ public function testGetTemplateOneWhen() public function testGetTemplateTwoWhen() { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Plugins\\MediaEmbed\\Configurator\\TemplateBuilder') - ->setMethods(['getTemplate']) + ->onlyMethods(['getTemplate']) ->getMock(); $mock->expects($this->exactly(3)) ->method('getTemplate') diff --git a/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/FlashTest.php b/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/FlashTest.php index 6e99f6fb83..d41f834182 100644 --- a/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/FlashTest.php +++ b/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/FlashTest.php @@ -8,14 +8,14 @@ * @covers s9e\TextFormatter\Plugins\MediaEmbed\Configurator\TemplateGenerator * @covers s9e\TextFormatter\Plugins\MediaEmbed\Configurator\TemplateGenerators\Flash */ -class FlashTest extends AbstractTest +class FlashTest extends AbstractTestClass { protected function getTemplateGenerator() { return new Flash; } - public function getGetTemplateTests() + public static function getGetTemplateTests() { return [ [ diff --git a/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/IframeTest.php b/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/IframeTest.php index d8676a520f..875dc8fb50 100644 --- a/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/IframeTest.php +++ b/tests/Plugins/MediaEmbed/Configurator/TemplateGenerators/IframeTest.php @@ -8,14 +8,14 @@ * @covers s9e\TextFormatter\Plugins\MediaEmbed\Configurator\TemplateGenerator * @covers s9e\TextFormatter\Plugins\MediaEmbed\Configurator\TemplateGenerators\Iframe */ -class IframeTest extends AbstractTest +class IframeTest extends AbstractTestClass { protected function getTemplateGenerator() { return new Iframe; } - public function getGetTemplateTests() + public static function getGetTemplateTests() { return [ [ diff --git a/tests/Plugins/MediaEmbed/ParserTest.php b/tests/Plugins/MediaEmbed/ParserTest.php index 10bfb3c82b..1cd7c425de 100644 --- a/tests/Plugins/MediaEmbed/ParserTest.php +++ b/tests/Plugins/MediaEmbed/ParserTest.php @@ -105,7 +105,7 @@ public function testAbstract() call_user_func_array([$this, 'testParsing'], func_get_args()); } - public function getAbstractTests() + public static function getAbstractTests() { return [ [ @@ -490,7 +490,7 @@ public function testScraping() $this->runScrapingTest('testParsing', func_get_args()); } - public function getScrapingTests() + public static function getScrapingTests() { return [ [ @@ -1378,7 +1378,7 @@ public function testScrapingRendering() $this->runScrapingTest('testRendering', func_get_args()); } - public function getScrapingRenderingTests() + public static function getScrapingRenderingTests() { return [ // [ @@ -1533,7 +1533,7 @@ function ($configurator) ]; } - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -4505,7 +4505,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ @@ -5428,7 +5428,7 @@ public function testLegacyRendering($xml, $html, $setup = null) $this->assertSame($html, $this->configurator->rendering->getRenderer()->render($xml)); } - public function getLegacyRenderingTests() + public static function getLegacyRenderingTests() { return [ [ @@ -5590,7 +5590,7 @@ public function testAmpRendering(string $siteId, string $text, string $html, $se $this->assertSame($html, $renderer->render($parser->parse($text))); } - public function getAmpRenderingTests() + public static function getAmpRenderingTests() { return [ [ diff --git a/tests/Plugins/PipeTables/ParserTest.php b/tests/Plugins/PipeTables/ParserTest.php index 3261a9d8bf..e13ab6f7f9 100644 --- a/tests/Plugins/PipeTables/ParserTest.php +++ b/tests/Plugins/PipeTables/ParserTest.php @@ -29,7 +29,7 @@ protected static function fixTests($tests) return $tests; } - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -387,7 +387,7 @@ function ($configurator) ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Plugins/Preg/ParserTest.php b/tests/Plugins/Preg/ParserTest.php index 2b018f9b3d..06f00d7895 100644 --- a/tests/Plugins/Preg/ParserTest.php +++ b/tests/Plugins/Preg/ParserTest.php @@ -18,7 +18,7 @@ class ParserTest extends Test use ParsingTestsJavaScriptRunner; use RenderingTestsRunner; - public function getParsingTests() + public static function getParsingTests() { return [ [ @@ -141,7 +141,7 @@ function ($configurator) ]; } - public function getRenderingTests() + public static function getRenderingTests() { return [ [ diff --git a/tests/Plugins/TaskLists/HelperTest.php b/tests/Plugins/TaskLists/HelperTest.php index 6a60180f0b..4197637a8b 100644 --- a/tests/Plugins/TaskLists/HelperTest.php +++ b/tests/Plugins/TaskLists/HelperTest.php @@ -27,7 +27,7 @@ public function testGetStats($text, $expected) $this->assertEquals($expected, Helper::getStats($xml)); } - public function getGetStatsTests() + public static function getGetStatsTests() { return [ [ @@ -75,7 +75,7 @@ public function testMarkTaskState($methodName, $xml, $id, $expected) $this->assertEquals($expected, Helper::$methodName($xml, $id)); } - public function getMarkTaskStateTests() + public static function getMarkTaskStateTests() { return [ [ diff --git a/tests/Plugins/TaskLists/ParserTest.php b/tests/Plugins/TaskLists/ParserTest.php index a68b157075..7dc7d50160 100644 --- a/tests/Plugins/TaskLists/ParserTest.php +++ b/tests/Plugins/TaskLists/ParserTest.php @@ -24,7 +24,7 @@ public function setUp(): void $this->configurator->Litedown; } - public function getParsingTests() + public static function getParsingTests() { return self::fixTests([ [ @@ -85,7 +85,7 @@ function ($configurator) ]); } - public function getRenderingTests() + public static function getRenderingTests() { return self::fixTests([ [ diff --git a/tests/Test.php b/tests/Test.php index fdae1f9a61..c7183b0cbf 100644 --- a/tests/Test.php +++ b/tests/Test.php @@ -17,22 +17,6 @@ protected function setUp(): void $this->configurator = new Configurator; } - public function __call($methodName, $args) - { - // Compatibility map for PHPUnit <9 - $map = [ - 'assertDoesNotMatchRegularExpression' => 'assertNotRegExp', - 'assertFileDoesNotExist' => 'assertFileNotExists', - 'assertMatchesRegularExpression' => 'assertRegExp' - ]; - if (!isset($map[$methodName])) - { - throw new RuntimeException("Unknown method '$methodName'"); - } - - return call_user_func_array([$this, $map[$methodName]], $args); - } - public static function tearDownAfterClass(): void { foreach (self::$tmpFiles as $filepath) @@ -199,11 +183,6 @@ public function tempnam() return $filepath; } - protected function runClosure($closure) - { - return $closure(); - } - protected static function ws($template) { return preg_replace('(>\\n\\s*<)', '><', trim($template)); diff --git a/tests/Utils/Http/Clients/AbstractTest.php b/tests/Utils/Http/Clients/AbstractTestClass.php similarity index 98% rename from tests/Utils/Http/Clients/AbstractTest.php rename to tests/Utils/Http/Clients/AbstractTestClass.php index 51d6839572..9a5b679bdc 100644 --- a/tests/Utils/Http/Clients/AbstractTest.php +++ b/tests/Utils/Http/Clients/AbstractTestClass.php @@ -4,7 +4,7 @@ use s9e\TextFormatter\Tests\Test; -abstract class AbstractTest extends Test +abstract class AbstractTestClass extends Test { abstract protected function getInstance(); diff --git a/tests/Utils/Http/Clients/CachedTest.php b/tests/Utils/Http/Clients/CachedTest.php index 97d852cabc..aa20c233c3 100644 --- a/tests/Utils/Http/Clients/CachedTest.php +++ b/tests/Utils/Http/Clients/CachedTest.php @@ -8,7 +8,7 @@ /** * @covers s9e\TextFormatter\Utils\Http\Clients\Cached */ -class CachedTest extends AbstractTest +class CachedTest extends AbstractTestClass { public static function tearDownAfterClass(): void { diff --git a/tests/Utils/Http/Clients/CurlTest.php b/tests/Utils/Http/Clients/CurlTest.php index 0b3eb1a2ac..f326a8ef5b 100644 --- a/tests/Utils/Http/Clients/CurlTest.php +++ b/tests/Utils/Http/Clients/CurlTest.php @@ -4,7 +4,7 @@ use s9e\TextFormatter\Utils\Http\Clients\Curl; -class CurlTest extends AbstractTest +class CurlTest extends AbstractTestClass { /** * @beforeClass diff --git a/tests/Utils/Http/Clients/NativeTest.php b/tests/Utils/Http/Clients/NativeTest.php index 9c11256cd9..f7b06b8d1d 100644 --- a/tests/Utils/Http/Clients/NativeTest.php +++ b/tests/Utils/Http/Clients/NativeTest.php @@ -4,7 +4,7 @@ use s9e\TextFormatter\Utils\Http\Clients\Native; -class NativeTest extends AbstractTest +class NativeTest extends AbstractTestClass { protected function getInstance() { diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index 7e7a0f643e..20fcc1f16e 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -19,7 +19,7 @@ public function testEncodeUnicodeSupplementaryCharacters($original, $expected) $this->assertSame($expected, Utils::encodeUnicodeSupplementaryCharacters($original)); } - public function getEncodeUnicodeSupplementaryCharactersTests() + public static function getEncodeUnicodeSupplementaryCharactersTests() { return [ [ @@ -39,7 +39,7 @@ public function testGetAttributeValues($xml, $tagName, $attrName, $expected) $this->assertSame($expected, Utils::getAttributeValues($xml, $tagName, $attrName)); } - public function getGetAttributeValuesTests() + public static function getGetAttributeValuesTests() { return [ [ @@ -102,7 +102,7 @@ public function testRemoveFormatting($original, $expected) $this->assertSame($expected, Utils::removeFormatting($original)); } - public function getRemoveFormattingTests() + public static function getRemoveFormattingTests() { return [ [ @@ -145,7 +145,7 @@ public function testRemoveTag($original, $args, $expected) ); } - public function getRemoveTagTests() + public static function getRemoveTagTests() { return [ [ @@ -210,7 +210,7 @@ public function testReplaceAttributes($original, $expected, $tagName, $callback) $this->assertSame($expected, Utils::replaceAttributes($original, $tagName, $callback)); } - public function getReplaceAttributesTests() + public static function getReplaceAttributesTests() { return [ [