From 4b25313d376ad61bf9fc976fd0dd6d1ec008bf4d Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Tue, 30 Jan 2024 10:57:46 +0100 Subject: [PATCH] [TASK] Make the data providers static This is required in newer PHPUnit versions. --- .../ValidatorResolverOptionsRuleTest.php | 4 ++-- tests/Unit/Type/ContextDynamicReturnTypeExtensionTest.php | 4 ++-- .../DateTimeAspectGetDynamicReturnTypeExtensionTest.php | 4 ++-- ...GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest.php | 4 ++-- .../MathUtilityTypeSpecifyingExtensionTest.php | 4 ++-- tests/Unit/Type/ObjectStorageStubFileTest.php | 4 ++-- .../PropertyMapperReturnTypeExtensionTest.php | 4 ++-- tests/Unit/Type/QueryFactoryStubFileTest.php | 4 ++-- .../QueryResultToArrayDynamicReturnTypeExtensionTest.php | 4 ++-- .../Type/RepositoryQueryDynamicReturnTypeExtensionTest.php | 4 ++-- tests/Unit/Type/RepositoryStubFileTest.php | 4 ++-- .../RequestGetAttributeDynamicReturnTypeExtensionTest.php | 4 ++-- .../Type/SiteGetAttributeDynamicReturnTypeExtensionTest.php | 4 ++-- .../UserAspectGetDynamicReturnTypeExtensionTest.php | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/Unit/Rule/ValidatorResolverOptionsRule/ValidatorResolverOptionsRuleTest.php b/tests/Unit/Rule/ValidatorResolverOptionsRule/ValidatorResolverOptionsRuleTest.php index ec204d7..f06dba4 100644 --- a/tests/Unit/Rule/ValidatorResolverOptionsRule/ValidatorResolverOptionsRuleTest.php +++ b/tests/Unit/Rule/ValidatorResolverOptionsRule/ValidatorResolverOptionsRuleTest.php @@ -13,7 +13,7 @@ final class ValidatorResolverOptionsRuleTest extends RuleTestCase { /** - * @dataProvider provideDataWithErrors() + * @dataProvider provideDataWithErrors * * @param list $expectedErrorMessagesWithLines */ @@ -27,7 +27,7 @@ public function testRuleWithoutErrors(): void $this->analyse([__DIR__ . '/Fixture/CreateValidatorWithCorrectOptions.php'], []); } - public function provideDataWithErrors(): \Iterator + public static function provideDataWithErrors(): \Iterator { yield [ __DIR__ . '/Fixture/CreateValidatorWithUnresolvableType.php', diff --git a/tests/Unit/Type/ContextDynamicReturnTypeExtensionTest.php b/tests/Unit/Type/ContextDynamicReturnTypeExtensionTest.php index 6b600f5..97025d8 100644 --- a/tests/Unit/Type/ContextDynamicReturnTypeExtensionTest.php +++ b/tests/Unit/Type/ContextDynamicReturnTypeExtensionTest.php @@ -10,10 +10,10 @@ class ContextDynamicReturnTypeExtensionTest extends TypeInferenceTestCase /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { // path to a file with actual asserts of expected types: - yield from $this->gatherAssertTypes(__DIR__ . '/data/context-get-aspect-return-types.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/context-get-aspect-return-types.php'); } /** diff --git a/tests/Unit/Type/DateTimeAspectGetDynamicReturnTypeExtension/DateTimeAspectGetDynamicReturnTypeExtensionTest.php b/tests/Unit/Type/DateTimeAspectGetDynamicReturnTypeExtension/DateTimeAspectGetDynamicReturnTypeExtensionTest.php index 94e3290..c91b59e 100644 --- a/tests/Unit/Type/DateTimeAspectGetDynamicReturnTypeExtension/DateTimeAspectGetDynamicReturnTypeExtensionTest.php +++ b/tests/Unit/Type/DateTimeAspectGetDynamicReturnTypeExtension/DateTimeAspectGetDynamicReturnTypeExtensionTest.php @@ -11,9 +11,9 @@ final class DateTimeAspectGetDynamicReturnTypeExtensionTest extends TypeInferenc * * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/datetime-aspect-get-return-types.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/datetime-aspect-get-return-types.php'); } /** diff --git a/tests/Unit/Type/GeneralUtilityGetIndpEnvDynamicReturnTypeExtension/GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest.php b/tests/Unit/Type/GeneralUtilityGetIndpEnvDynamicReturnTypeExtension/GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest.php index 0c52440..9999fac 100644 --- a/tests/Unit/Type/GeneralUtilityGetIndpEnvDynamicReturnTypeExtension/GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest.php +++ b/tests/Unit/Type/GeneralUtilityGetIndpEnvDynamicReturnTypeExtension/GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest.php @@ -10,9 +10,9 @@ final class GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest extends TypeI /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/GeneralUtilityGetIndpEnvTest.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/GeneralUtilityGetIndpEnvTest.php'); } /** diff --git a/tests/Unit/Type/MathUtilityTypeSpecifyingExtension/MathUtilityTypeSpecifyingExtensionTest.php b/tests/Unit/Type/MathUtilityTypeSpecifyingExtension/MathUtilityTypeSpecifyingExtensionTest.php index a9cc8c6..b1dada7 100644 --- a/tests/Unit/Type/MathUtilityTypeSpecifyingExtension/MathUtilityTypeSpecifyingExtensionTest.php +++ b/tests/Unit/Type/MathUtilityTypeSpecifyingExtension/MathUtilityTypeSpecifyingExtensionTest.php @@ -10,9 +10,9 @@ final class MathUtilityTypeSpecifyingExtensionTest extends TypeInferenceTestCase /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/MathUtilityTest.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/MathUtilityTest.php'); } /** diff --git a/tests/Unit/Type/ObjectStorageStubFileTest.php b/tests/Unit/Type/ObjectStorageStubFileTest.php index fc58305..0df4813 100644 --- a/tests/Unit/Type/ObjectStorageStubFileTest.php +++ b/tests/Unit/Type/ObjectStorageStubFileTest.php @@ -10,9 +10,9 @@ class ObjectStorageStubFileTest extends TypeInferenceTestCase /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/object-storage-stub-files.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/object-storage-stub-files.php'); } /** diff --git a/tests/Unit/Type/PropertyMapperReturnTypeExtension/PropertyMapperReturnTypeExtensionTest.php b/tests/Unit/Type/PropertyMapperReturnTypeExtension/PropertyMapperReturnTypeExtensionTest.php index 5bf67da..b79924a 100644 --- a/tests/Unit/Type/PropertyMapperReturnTypeExtension/PropertyMapperReturnTypeExtensionTest.php +++ b/tests/Unit/Type/PropertyMapperReturnTypeExtension/PropertyMapperReturnTypeExtensionTest.php @@ -10,9 +10,9 @@ final class PropertyMapperReturnTypeExtensionTest extends TypeInferenceTestCase /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/property-converter-types.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/property-converter-types.php'); } /** diff --git a/tests/Unit/Type/QueryFactoryStubFileTest.php b/tests/Unit/Type/QueryFactoryStubFileTest.php index e7d73ef..bfa85e9 100644 --- a/tests/Unit/Type/QueryFactoryStubFileTest.php +++ b/tests/Unit/Type/QueryFactoryStubFileTest.php @@ -10,9 +10,9 @@ class QueryFactoryStubFileTest extends TypeInferenceTestCase /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/query-factory-stub-files.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/query-factory-stub-files.php'); } /** diff --git a/tests/Unit/Type/QueryResultToArrayDynamicReturnTypeExtension/QueryResultToArrayDynamicReturnTypeExtensionTest.php b/tests/Unit/Type/QueryResultToArrayDynamicReturnTypeExtension/QueryResultToArrayDynamicReturnTypeExtensionTest.php index 622b994..6139b9c 100644 --- a/tests/Unit/Type/QueryResultToArrayDynamicReturnTypeExtension/QueryResultToArrayDynamicReturnTypeExtensionTest.php +++ b/tests/Unit/Type/QueryResultToArrayDynamicReturnTypeExtension/QueryResultToArrayDynamicReturnTypeExtensionTest.php @@ -10,9 +10,9 @@ final class QueryResultToArrayDynamicReturnTypeExtensionTest extends TypeInferen /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/query-result-to-array.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/query-result-to-array.php'); } /** diff --git a/tests/Unit/Type/RepositoryQueryDynamicReturnTypeExtensionTest.php b/tests/Unit/Type/RepositoryQueryDynamicReturnTypeExtensionTest.php index fb23971..9e8c91a 100644 --- a/tests/Unit/Type/RepositoryQueryDynamicReturnTypeExtensionTest.php +++ b/tests/Unit/Type/RepositoryQueryDynamicReturnTypeExtensionTest.php @@ -10,9 +10,9 @@ class RepositoryQueryDynamicReturnTypeExtensionTest extends TypeInferenceTestCas /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/custom-query-type.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/custom-query-type.php'); } /** diff --git a/tests/Unit/Type/RepositoryStubFileTest.php b/tests/Unit/Type/RepositoryStubFileTest.php index a4176a3..b7f0c53 100644 --- a/tests/Unit/Type/RepositoryStubFileTest.php +++ b/tests/Unit/Type/RepositoryStubFileTest.php @@ -10,9 +10,9 @@ class RepositoryStubFileTest extends TypeInferenceTestCase /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/repository-stub-files.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/repository-stub-files.php'); } /** diff --git a/tests/Unit/Type/RequestGetAttributeDynamicReturnTypeExtensionTest.php b/tests/Unit/Type/RequestGetAttributeDynamicReturnTypeExtensionTest.php index 9338cdf..ba036be 100644 --- a/tests/Unit/Type/RequestGetAttributeDynamicReturnTypeExtensionTest.php +++ b/tests/Unit/Type/RequestGetAttributeDynamicReturnTypeExtensionTest.php @@ -10,10 +10,10 @@ class RequestGetAttributeDynamicReturnTypeExtensionTest extends TypeInferenceTes /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { // path to a file with actual asserts of expected types: - yield from $this->gatherAssertTypes(__DIR__ . '/data/request-get-attribute-return-types.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/request-get-attribute-return-types.php'); } /** diff --git a/tests/Unit/Type/SiteGetAttributeDynamicReturnTypeExtensionTest.php b/tests/Unit/Type/SiteGetAttributeDynamicReturnTypeExtensionTest.php index 654c470..95065c4 100644 --- a/tests/Unit/Type/SiteGetAttributeDynamicReturnTypeExtensionTest.php +++ b/tests/Unit/Type/SiteGetAttributeDynamicReturnTypeExtensionTest.php @@ -10,10 +10,10 @@ class SiteGetAttributeDynamicReturnTypeExtensionTest extends TypeInferenceTestCa /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { // path to a file with actual asserts of expected types: - yield from $this->gatherAssertTypes(__DIR__ . '/data/site-get-attribute-return-types.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/site-get-attribute-return-types.php'); } /** diff --git a/tests/Unit/Type/UserAspectGetDynamicReturnTypeExtension/UserAspectGetDynamicReturnTypeExtensionTest.php b/tests/Unit/Type/UserAspectGetDynamicReturnTypeExtension/UserAspectGetDynamicReturnTypeExtensionTest.php index 3837473..89b190b 100644 --- a/tests/Unit/Type/UserAspectGetDynamicReturnTypeExtension/UserAspectGetDynamicReturnTypeExtensionTest.php +++ b/tests/Unit/Type/UserAspectGetDynamicReturnTypeExtension/UserAspectGetDynamicReturnTypeExtensionTest.php @@ -11,9 +11,9 @@ final class UserAspectGetDynamicReturnTypeExtensionTest extends TypeInferenceTes * * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { - yield from $this->gatherAssertTypes(__DIR__ . '/data/user-aspect-get-return-types.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/user-aspect-get-return-types.php'); } /**