Skip to content

Commit 8e7e120

Browse files
Merge branch '5.4' into 6.2
* 5.4: Migrate to `static` data providers using `rector/rector`
2 parents 04c27d5 + 737cb97 commit 8e7e120

28 files changed

+38
-38
lines changed

Tests/CacheWarmer/SerializerCacheWarmerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testWarmUp(array $loaders)
4040
$this->assertTrue($arrayPool->getItem('Symfony_Bundle_FrameworkBundle_Tests_Fixtures_Serialization_Author')->isHit());
4141
}
4242

43-
public function loaderProvider()
43+
public static function loaderProvider()
4444
{
4545
return [
4646
[

Tests/Command/CachePoolClearCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function testComplete(array $input, array $expectedSuggestions)
4444
$this->assertSame($expectedSuggestions, $suggestions);
4545
}
4646

47-
public function provideCompletionSuggestions()
47+
public static function provideCompletionSuggestions()
4848
{
4949
yield 'pool_name' => [
5050
['f'],

Tests/Command/CachePoolDeleteCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testComplete(array $input, array $expectedSuggestions)
9898
$this->assertSame($expectedSuggestions, $suggestions);
9999
}
100100

101-
public function provideCompletionSuggestions()
101+
public static function provideCompletionSuggestions()
102102
{
103103
yield 'pool_name' => [
104104
['f'],

Tests/Command/EventDispatcherDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testComplete(array $input, array $expectedSuggestions)
3131
$this->assertSame($expectedSuggestions, $suggestions);
3232
}
3333

34-
public function provideCompletionSuggestions()
34+
public static function provideCompletionSuggestions()
3535
{
3636
yield 'event' => [[''], ['Symfony\Component\Mailer\Event\MessageEvent', 'console.command']];
3737
yield 'event for other dispatcher' => [['--dispatcher', 'other_event_dispatcher', ''], ['other_event', 'App\OtherEvent']];

Tests/Command/SecretsRemoveCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testComplete(bool $withLocalVault, array $input, array $expected
3737
$this->assertSame($expectedSuggestions, $suggestions);
3838
}
3939

40-
public function provideCompletionSuggestions()
40+
public static function provideCompletionSuggestions()
4141
{
4242
yield 'name' => [true, [''], ['SECRET', 'OTHER_SECRET']];
4343
yield '--local name (with local vault)' => [true, ['--local', ''], ['SECRET']];

Tests/Command/SecretsSetCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testComplete(array $input, array $expectedSuggestions)
3232
$this->assertSame($expectedSuggestions, $suggestions);
3333
}
3434

35-
public function provideCompletionSuggestions()
35+
public static function provideCompletionSuggestions()
3636
{
3737
yield 'name' => [[''], ['SECRET', 'OTHER_SECRET']];
3838
yield '--local name (with local vault)' => [['--local', ''], ['SECRET', 'OTHER_SECRET']];

Tests/Command/TranslationDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function ($path, $catalogue) use ($extractedMessagesWithDomains) {
269269
$this->assertSame($expectedSuggestions, $suggestions);
270270
}
271271

272-
public function provideCompletionSuggestions()
272+
public static function provideCompletionSuggestions()
273273
{
274274
yield 'locale' => [
275275
[''],

Tests/Command/TranslationUpdateCommandCompletionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testComplete(array $input, array $expectedSuggestions)
4242
$this->assertSame($expectedSuggestions, $suggestions);
4343
}
4444

45-
public function provideCompletionSuggestions()
45+
public static function provideCompletionSuggestions()
4646
{
4747
$bundle = new ExtensionPresentBundle();
4848

Tests/Command/WorkflowDumpCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testComplete(array $input, array $expectedSuggestions)
3232
$this->assertSame($expectedSuggestions, $suggestions);
3333
}
3434

35-
public function provideCompletionSuggestions(): iterable
35+
public static function provideCompletionSuggestions(): iterable
3636
{
3737
yield 'option --dump-format' => [['--dump-format', ''], ['puml', 'mermaid', 'dot']];
3838
}

Tests/Controller/RedirectControllerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testRoute($permanent, $keepRequestMethod, $keepQueryParams, $ign
103103
$this->assertEquals($expectedCode, $returnResponse->getStatusCode());
104104
}
105105

106-
public function provider()
106+
public static function provider()
107107
{
108108
return [
109109
[true, false, false, false, 301, ['additional-parameter' => 'value']],
@@ -210,7 +210,7 @@ public function testUrlRedirectDefaultPorts()
210210
$this->assertRedirectUrl($returnValue, $expectedUrl);
211211
}
212212

213-
public function urlRedirectProvider()
213+
public static function urlRedirectProvider()
214214
{
215215
return [
216216
// Standard ports
@@ -262,7 +262,7 @@ public function testUrlRedirect($scheme, $httpPort, $httpsPort, $requestScheme,
262262
$this->assertRedirectUrl($returnValue, $expectedUrl);
263263
}
264264

265-
public function pathQueryParamsProvider()
265+
public static function pathQueryParamsProvider()
266266
{
267267
return [
268268
['http://www.example.com/base/redirect-path', '/redirect-path', ''],

Tests/DependencyInjection/Compiler/DataCollectorTranslatorPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testProcessKeepsDataCollectorIfTranslatorImplementsTranslatorBag
6565
$this->assertTrue($this->container->hasDefinition('data_collector.translation'));
6666
}
6767

68-
public function getImplementingTranslatorBagInterfaceTranslatorClassNames()
68+
public static function getImplementingTranslatorBagInterfaceTranslatorClassNames()
6969
{
7070
return [
7171
['Symfony\Component\Translation\Translator'],
@@ -97,7 +97,7 @@ public function testProcessRemovesDataCollectorIfTranslatorDoesNotImplementTrans
9797
$this->assertFalse($this->container->hasDefinition('data_collector.translation'));
9898
}
9999

100-
public function getNotImplementingTranslatorBagInterfaceTranslatorClassNames()
100+
public static function getNotImplementingTranslatorBagInterfaceTranslatorClassNames()
101101
{
102102
return [
103103
['Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\TranslatorWithTranslatorBag'],

Tests/DependencyInjection/Compiler/ProfilerPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testValidCollector()
6262
$this->assertEquals('add', $methodCalls[0][0]); // grab the method part of the first call
6363
}
6464

65-
public function provideValidCollectorWithTemplateUsingAutoconfigure(): \Generator
65+
public static function provideValidCollectorWithTemplateUsingAutoconfigure(): \Generator
6666
{
6767
yield [new class() implements TemplateAwareDataCollectorInterface {
6868
public function collect(Request $request, Response $response, \Throwable $exception = null)

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testInvalidSessionName($sessionName)
6161
);
6262
}
6363

64-
public function getTestInvalidSessionName()
64+
public static function getTestInvalidSessionName()
6565
{
6666
return [
6767
['a.b'],
@@ -115,7 +115,7 @@ public function testValidAssetsPackageNameConfiguration($packageName)
115115
$this->assertArrayHasKey($packageName, $config['assets']['packages']);
116116
}
117117

118-
public function provideValidAssetsPackageNameConfigurationTests()
118+
public static function provideValidAssetsPackageNameConfigurationTests()
119119
{
120120
return [
121121
['foobar'],
@@ -142,7 +142,7 @@ public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMess
142142
]);
143143
}
144144

145-
public function provideInvalidAssetConfigurationTests()
145+
public static function provideInvalidAssetConfigurationTests()
146146
{
147147
// helper to turn config into embedded package config
148148
$createPackageConfig = function (array $packageConfig) {
@@ -196,7 +196,7 @@ public function testValidLockConfiguration($lockConfig, $processedConfig)
196196
$this->assertEquals($processedConfig, $config['lock']);
197197
}
198198

199-
public function provideValidLockConfigurationTests()
199+
public static function provideValidLockConfigurationTests()
200200
{
201201
yield [null, ['enabled' => true, 'resources' => ['default' => [class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock']]]];
202202

@@ -290,7 +290,7 @@ public function testValidSemaphoreConfiguration($semaphoreConfig, $processedConf
290290
$this->assertEquals($processedConfig, $config['semaphore']);
291291
}
292292

293-
public function provideValidSemaphoreConfigurationTests()
293+
public static function provideValidSemaphoreConfigurationTests()
294294
{
295295
yield [null, ['enabled' => true, 'resources' => []]];
296296

Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,7 @@ public function testAppRedisTagAwareAdapter(string $configFile)
17221722
}
17231723
}
17241724

1725-
public function appRedisTagAwareConfigProvider(): array
1725+
public static function appRedisTagAwareConfigProvider(): array
17261726
{
17271727
return [
17281728
['cache_app_redis_tag_aware'],
@@ -1937,7 +1937,7 @@ public function testHttpClientFullDefaultOptions()
19371937
], $defaultOptions['peer_fingerprint']);
19381938
}
19391939

1940-
public function provideMailer(): array
1940+
public static function provideMailer(): array
19411941
{
19421942
return [
19431943
['mailer_with_dsn', ['main' => 'smtp://example.com']],

Tests/Functional/AbstractAttributeRoutingTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testAnnotatedController(string $path, string $expectedValue)
3131
$this->assertSame('/annotated/create-transaction', $router->generate('symfony_framework_tests_functional_test_annotated_createtransaction'));
3232
}
3333

34-
public function getRoutes(): array
34+
public static function getRoutes(): array
3535
{
3636
return [
3737
['/null_request', Request::class],

Tests/Functional/ConfigDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function testComplete(array $input, array $expectedSuggestions)
150150
}
151151
}
152152

153-
public function provideCompletionSuggestions(): \Generator
153+
public static function provideCompletionSuggestions(): \Generator
154154
{
155155
yield 'name' => [[''], ['default_config_test', 'extension_without_config_test', 'framework', 'test']];
156156

Tests/Functional/ConfigDumpReferenceCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testComplete(array $input, array $expectedSuggestions)
103103
$this->assertSame($expectedSuggestions, $suggestions);
104104
}
105105

106-
public function provideCompletionSuggestions(): iterable
106+
public static function provideCompletionSuggestions(): iterable
107107
{
108108
yield 'name' => [[''], ['DefaultConfigTestBundle', 'default_config_test', 'ExtensionWithoutConfigTestBundle', 'extension_without_config_test', 'FrameworkBundle', 'framework', 'TestBundle', 'test']];
109109
yield 'option --format' => [['--format', ''], ['yaml', 'xml']];

Tests/Functional/ContainerDebugCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function testGetDeprecationNoFile()
241241
$this->assertStringContainsString('[WARNING] The deprecation file does not exist', $tester->getDisplay());
242242
}
243243

244-
public function provideIgnoreBackslashWhenFindingService()
244+
public static function provideIgnoreBackslashWhenFindingService()
245245
{
246246
return [
247247
[BackslashClass::class],
@@ -269,7 +269,7 @@ public function testComplete(array $input, array $expectedSuggestions, array $no
269269
}
270270
}
271271

272-
public function provideCompletionSuggestions()
272+
public static function provideCompletionSuggestions()
273273
{
274274
$serviceId = 'console.command.container_debug';
275275
$hiddenServiceId = '.console.command.container_debug.lazy';

Tests/Functional/DebugAutowiringCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function testComplete(array $input, array $expectedSuggestions)
129129
}
130130
}
131131

132-
public function provideCompletionSuggestions(): \Generator
132+
public static function provideCompletionSuggestions(): \Generator
133133
{
134134
yield 'search' => [[''], ['SessionHandlerInterface', 'Psr\\Log\\LoggerInterface', 'Psr\\Container\\ContainerInterface $parameterBag']];
135135
}

Tests/Functional/FragmentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testFragment($insulate)
3737
, $client->getResponse()->getContent());
3838
}
3939

40-
public function getConfigs()
40+
public static function getConfigs()
4141
{
4242
return [
4343
[false],

Tests/Functional/ProfilerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testProfilerCollectParameter($insulate)
5757
$this->assertNull($client->getProfile());
5858
}
5959

60-
public function getConfigs()
60+
public static function getConfigs()
6161
{
6262
return [
6363
[false],

Tests/Functional/RouterDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function testComplete(array $input, array $expectedSuggestions)
9696
$this->assertSame($expectedSuggestions, $tester->complete($input));
9797
}
9898

99-
public function provideCompletionSuggestions()
99+
public static function provideCompletionSuggestions()
100100
{
101101
yield 'option --format' => [
102102
['--format', ''],

Tests/Functional/RoutingConditionServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testCondition(int $code, string $path)
2424
$this->assertSame($code, $client->getResponse()->getStatusCode());
2525
}
2626

27-
public function provideRoutes(): iterable
27+
public static function provideRoutes(): iterable
2828
{
2929
yield 'allowed by an autoconfigured service' => [
3030
200,

Tests/Functional/SecurityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testLoginUser(string $username, array $roles, ?string $firewallC
3333
$this->assertEquals('Welcome '.$username.'!', $client->getResponse()->getContent());
3434
}
3535

36-
public function getUsers()
36+
public static function getUsers()
3737
{
3838
yield ['the-username', ['ROLE_FOO'], null];
3939
yield ['the-username', ['ROLE_FOO'], 'main'];

Tests/Functional/SerializerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testNormalizersAndEncodersUseDefaultContextConfigOption(string $
5252
self::assertEquals('foo', $defaultContext['fake_context_option']);
5353
}
5454

55-
public function provideNormalizersAndEncodersWithDefaultContextOption(): array
55+
public static function provideNormalizersAndEncodersWithDefaultContextOption(): array
5656
{
5757
return [
5858
['serializer.normalizer.constraint_violation_list.alias'],

Tests/Functional/SessionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function testCorrectCacheControlHeadersForCacheableAction($config, $insul
144144
$this->assertSame('public, s-maxage=100', $response->headers->get('cache-control'));
145145
}
146146

147-
public function getConfigs()
147+
public static function getConfigs()
148148
{
149149
return [
150150
// configfile, insulate

Tests/Routing/RouterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ public function testBooleanContainerParametersWithinRouteCondition()
511511
$this->assertSame('1 or 0', $route->getCondition());
512512
}
513513

514-
public function getNonStringValues()
514+
public static function getNonStringValues()
515515
{
516516
return [[null], [false], [true], [new \stdClass()], [['foo', 'bar']], [[[]]]];
517517
}
@@ -591,7 +591,7 @@ public function testResolvingMethods()
591591
$this->assertEquals(['GET', 'POST'], $route->getMethods());
592592
}
593593

594-
public function getContainerParameterForRoute()
594+
public static function getContainerParameterForRoute()
595595
{
596596
yield 'String' => ['"foo"'];
597597
yield 'Integer' => [0];

Tests/Translation/TranslatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function testResourceFilesOptionLoadsBeforeOtherAddedResources($debug, $e
178178
$translator->trans('some_message', [], null, 'some_locale');
179179
}
180180

181-
public function getDebugModeAndCacheDirCombinations()
181+
public static function getDebugModeAndCacheDirCombinations()
182182
{
183183
return [
184184
[false, false],

0 commit comments

Comments
 (0)