Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  Migrate to `static` data providers using `rector/rector`
  • Loading branch information
nicolas-grekas committed Feb 14, 2023
2 parents c232a91 + d0ec59b commit 35cb504
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Tests/ArgumentResolver/EntityValueResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function testUsedProperIdentifier()
$this->assertSame([null], $resolver->resolve($request, $argument));
}

public function idsProvider(): iterable
public static function idsProvider(): iterable
{
yield [1];
yield [0];
Expand Down
2 changes: 1 addition & 1 deletion Tests/DataCollector/DoctrineDataCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function testSerialization($param, array $types, $expected)
$this->assertTrue($collectedQueries['default'][0]['runnable']);
}

public function paramProvider(): array
public static function paramProvider(): array
{
return [
['some value', [], 'some value'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function testSerialization($param, array $types, $expected, $explainable,
$this->assertSame($runnable, $collectedQueries['default'][0]['runnable']);
}

public function paramProvider(): array
public static function paramProvider(): array
{
return [
['some value', [], 'some value', true],
Expand Down
6 changes: 3 additions & 3 deletions Tests/DependencyInjection/DoctrineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function testFixManagersAutoMappingsWithTwoAutomappings()
$method->invoke($this->extension, $emConfigs, $bundles);
}

public function getAutomappingData()
public static function getAutomappingData()
{
return [
[
Expand Down Expand Up @@ -194,7 +194,7 @@ public function testMappingTypeDetection()
$this->assertSame($mappingType, 'attribute');
}

public function providerBasicDrivers()
public static function providerBasicDrivers()
{
return [
['doctrine.orm.cache.apc.class', ['type' => 'apc']],
Expand Down Expand Up @@ -273,7 +273,7 @@ public function testUnrecognizedCacheDriverException()
$this->invokeLoadCacheDriver($objectManager, $container, $cacheName);
}

public function providerBundles()
public static function providerBundles()
{
yield ['AnnotationsBundle', 'annotation', '/Entity'];
yield ['AnnotationsOneLineBundle', 'annotation', '/Entity'];
Expand Down
4 changes: 2 additions & 2 deletions Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,15 @@ public function testEmbeddedIdentifierName()
$loader->getEntitiesByIds('id.value', [1, '', 2, 3, 'foo']);
}

public function provideGuidEntityClasses()
public static function provideGuidEntityClasses()
{
return [
['Symfony\Bridge\Doctrine\Tests\Fixtures\GuidIdEntity'],
['Symfony\Bridge\Doctrine\Tests\Fixtures\UuidIdEntity'],
];
}

public function provideUidEntityClasses()
public static function provideUidEntityClasses()
{
return [
['Symfony\Bridge\Doctrine\Tests\Fixtures\UuidIdEntity'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Form/Type/EntityTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function testChoiceTranslationDomainIsDisabledByDefault($expanded)
}
}

public function choiceTranslationDomainProvider()
public static function choiceTranslationDomainProvider()
{
return [
[false],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Logger/DbalLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testLog($sql, $params, $logParams)
$dbalLogger->startQuery($sql, $params);
}

public function getLogFixtures()
public static function getLogFixtures()
{
return [
['SQL', null, []],
Expand Down
6 changes: 3 additions & 3 deletions Tests/Middleware/Debug/MiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private function getResourceFromString(string $str)
return $res;
}

public function provideExecuteMethod(): array
public static function provideExecuteMethod(): array
{
return [
'executeStatement' => [
Expand Down Expand Up @@ -168,7 +168,7 @@ public function testWithParamBound(callable $executeMethod)
$this->assertGreaterThan(0, $debug[1]['executionMS']);
}

public function provideEndTransactionMethod(): array
public static function provideEndTransactionMethod(): array
{
return [
'commit' => [static fn (Connection $conn) => $conn->commit(), '"COMMIT"'],
Expand Down Expand Up @@ -208,7 +208,7 @@ public function testTransaction(callable $endTransactionMethod, string $expected
$this->assertGreaterThan(0, $debug[6]['executionMS']);
}

public function provideExecuteAndEndTransactionMethods(): array
public static function provideExecuteAndEndTransactionMethods(): array
{
return [
'commit and exec' => [
Expand Down
2 changes: 1 addition & 1 deletion Tests/PropertyInfo/DoctrineExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function testExtractEnum()
$this->assertNull($this->createExtractor()->getTypes(DoctrineEnum::class, 'enumCustom', []));
}

public function typesProvider()
public static function typesProvider()
{
$provider = [
['id', [new Type(Type::BUILTIN_TYPE_INT)]],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Types/UlidTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function testGetGuidTypeDeclarationSQL(AbstractPlatform $platform, string
$this->assertEquals($expectedDeclaration, $this->type->getSqlDeclaration(['length' => 36], $platform));
}

public function provideSqlDeclarations(): array
public static function provideSqlDeclarations(): array
{
return [
[new PostgreSQLPlatform(), 'UUID'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Types/UuidTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function testGetGuidTypeDeclarationSQL(AbstractPlatform $platform, string
$this->assertEquals($expectedDeclaration, $this->type->getSqlDeclaration(['length' => 36], $platform));
}

public function provideSqlDeclarations(): array
public static function provideSqlDeclarations(): array
{
return [
[new PostgreSQLPlatform(), 'UUID'],
Expand Down
14 changes: 7 additions & 7 deletions Tests/Validator/Constraints/UniqueEntityValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function testValidateUniqueness(UniqueEntity $constraint)
->assertRaised();
}

public function provideUniquenessConstraints(): iterable
public static function provideUniquenessConstraints(): iterable
{
yield 'Doctrine style' => [new UniqueEntity([
'message' => 'myMessage',
Expand Down Expand Up @@ -219,7 +219,7 @@ public function testValidateCustomErrorPath(UniqueEntity $constraint)
->assertRaised();
}

public function provideConstraintsWithCustomErrorPath(): iterable
public static function provideConstraintsWithCustomErrorPath(): iterable
{
yield 'Doctrine style' => [new UniqueEntity([
'message' => 'myMessage',
Expand Down Expand Up @@ -278,7 +278,7 @@ public function testValidateUniquenessWithIgnoreNullDisabled(UniqueEntity $const
->assertRaised();
}

public function provideConstraintsWithIgnoreNullDisabled(): iterable
public static function provideConstraintsWithIgnoreNullDisabled(): iterable
{
yield 'Doctrine style' => [new UniqueEntity([
'message' => 'myMessage',
Expand Down Expand Up @@ -325,7 +325,7 @@ public function testNoValidationIfFirstFieldIsNullAndNullValuesAreIgnored(Unique
$this->assertNoViolation();
}

public function provideConstraintsWithIgnoreNullEnabled(): iterable
public static function provideConstraintsWithIgnoreNullEnabled(): iterable
{
yield 'Doctrine style' => [new UniqueEntity([
'message' => 'myMessage',
Expand Down Expand Up @@ -424,7 +424,7 @@ function () use ($entity) {
$this->assertNoViolation();
}

public function provideConstraintsWithCustomRepositoryMethod(): iterable
public static function provideConstraintsWithCustomRepositoryMethod(): iterable
{
yield 'Doctrine style' => [new UniqueEntity([
'message' => 'myMessage',
Expand Down Expand Up @@ -463,7 +463,7 @@ public function testValidateResultTypes($entity1, $result)
$this->assertNoViolation();
}

public function resultTypesProvider()
public static function resultTypesProvider()
{
$entity = new SingleIntIdEntity(1, 'foo');

Expand Down Expand Up @@ -876,7 +876,7 @@ public function testValueCanBeNull()
$this->assertNoViolation();
}

public function resultWithEmptyIterator(): array
public static function resultWithEmptyIterator(): array
{
$entity = new SingleIntIdEntity(1, 'foo');

Expand Down
2 changes: 1 addition & 1 deletion Tests/Validator/DoctrineLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function testClassValidator(bool $expected, string $classValidatorRegexp
$this->assertSame($expected, $doctrineLoader->loadClassMetadata($classMetadata));
}

public function regexpProvider()
public static function regexpProvider()
{
return [
[false, null],
Expand Down

0 comments on commit 35cb504

Please sign in to comment.