Skip to content

Commit

Permalink
Merge pull request #145 from oliverklee/task/static-data-providers
Browse files Browse the repository at this point in the history
[TASK] Make the data providers static
  • Loading branch information
sascha-egerer committed Jan 30, 2024
2 parents 899c424 + 4b25313 commit 0cecc8f
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class ValidatorResolverOptionsRuleTest extends RuleTestCase
{

/**
* @dataProvider provideDataWithErrors()
* @dataProvider provideDataWithErrors
*
* @param list<array{0: string, 1: int, 2?: string}> $expectedErrorMessagesWithLines
*/
Expand All @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Type/ContextDynamicReturnTypeExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class ContextDynamicReturnTypeExtensionTest extends TypeInferenceTestCase
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ final class DateTimeAspectGetDynamicReturnTypeExtensionTest extends TypeInferenc
*
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ final class GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest extends TypeI
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ final class MathUtilityTypeSpecifyingExtensionTest extends TypeInferenceTestCase
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Type/ObjectStorageStubFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class ObjectStorageStubFileTest extends TypeInferenceTestCase
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ final class PropertyMapperReturnTypeExtensionTest extends TypeInferenceTestCase
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Type/QueryFactoryStubFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class QueryFactoryStubFileTest extends TypeInferenceTestCase
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ final class QueryResultToArrayDynamicReturnTypeExtensionTest extends TypeInferen
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class RepositoryQueryDynamicReturnTypeExtensionTest extends TypeInferenceTestCas
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Type/RepositoryStubFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class RepositoryStubFileTest extends TypeInferenceTestCase
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class RequestGetAttributeDynamicReturnTypeExtensionTest extends TypeInferenceTes
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class SiteGetAttributeDynamicReturnTypeExtensionTest extends TypeInferenceTestCa
/**
* @return iterable<mixed>
*/
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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ final class UserAspectGetDynamicReturnTypeExtensionTest extends TypeInferenceTes
*
* @return iterable<mixed>
*/
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');
}

/**
Expand Down

0 comments on commit 0cecc8f

Please sign in to comment.