Skip to content

Commit 7e1dafb

Browse files
OskarStarknicolas-grekas
authored andcommitted
Migrate to static data providers using rector/rector
1 parent af1b7c6 commit 7e1dafb

27 files changed

+36
-36
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
@@ -31,7 +31,7 @@ public function testComplete(array $input, array $expectedSuggestions)
3131
$this->assertSame($expectedSuggestions, $suggestions);
3232
}
3333

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

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testInvalidSessionName($sessionName)
6060
);
6161
}
6262

63-
public function getTestInvalidSessionName()
63+
public static function getTestInvalidSessionName()
6464
{
6565
return [
6666
['a.b'],
@@ -113,7 +113,7 @@ public function testValidAssetsPackageNameConfiguration($packageName)
113113
$this->assertArrayHasKey($packageName, $config['assets']['packages']);
114114
}
115115

116-
public function provideValidAssetsPackageNameConfigurationTests()
116+
public static function provideValidAssetsPackageNameConfigurationTests()
117117
{
118118
return [
119119
['foobar'],
@@ -139,7 +139,7 @@ public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMess
139139
]);
140140
}
141141

142-
public function provideInvalidAssetConfigurationTests()
142+
public static function provideInvalidAssetConfigurationTests()
143143
{
144144
// helper to turn config into embedded package config
145145
$createPackageConfig = function (array $packageConfig) {
@@ -192,7 +192,7 @@ public function testValidLockConfiguration($lockConfig, $processedConfig)
192192
$this->assertEquals($processedConfig, $config['lock']);
193193
}
194194

195-
public function provideValidLockConfigurationTests()
195+
public static function provideValidLockConfigurationTests()
196196
{
197197
yield [null, ['enabled' => true, 'resources' => ['default' => [class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock']]]];
198198

Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ public function testAppRedisTagAwareAdapter(string $configFile)
17511751
}
17521752
}
17531753

1754-
public function appRedisTagAwareConfigProvider(): array
1754+
public static function appRedisTagAwareConfigProvider(): array
17551755
{
17561756
return [
17571757
['cache_app_redis_tag_aware'],
@@ -1930,7 +1930,7 @@ public function testHttpClientFullDefaultOptions()
19301930
], $defaultOptions['peer_fingerprint']);
19311931
}
19321932

1933-
public function provideMailer(): array
1933+
public static function provideMailer(): array
19341934
{
19351935
return [
19361936
['mailer_with_dsn', ['main' => 'smtp://example.com']],

Tests/Functional/AnnotatedControllerTest.php

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

32-
public function getRoutes()
32+
public static function getRoutes()
3333
{
3434
return [
3535
['/null_request', 'Symfony\Component\HttpFoundation\Request'],

Tests/Functional/ConfigDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function testComplete(array $input, array $expectedSuggestions)
138138
}
139139
}
140140

141-
public function provideCompletionSuggestions(): \Generator
141+
public static function provideCompletionSuggestions(): \Generator
142142
{
143143
yield 'name' => [[''], ['default_config_test', 'extension_without_config_test', 'framework', 'test']];
144144

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
@@ -204,7 +204,7 @@ public function testGetDeprecationNoFile()
204204
$this->assertStringContainsString('[WARNING] The deprecation file does not exist', $tester->getDisplay());
205205
}
206206

207-
public function provideIgnoreBackslashWhenFindingService()
207+
public static function provideIgnoreBackslashWhenFindingService()
208208
{
209209
return [
210210
[BackslashClass::class],
@@ -232,7 +232,7 @@ public function testComplete(array $input, array $expectedSuggestions, array $no
232232
}
233233
}
234234

235-
public function provideCompletionSuggestions()
235+
public static function provideCompletionSuggestions()
236236
{
237237
$serviceId = 'console.command.container_debug';
238238
$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
@@ -100,7 +100,7 @@ public function testComplete(array $input, array $expectedSuggestions)
100100
$this->assertSame($expectedSuggestions, $tester->complete($input));
101101
}
102102

103-
public function provideCompletionSuggestions()
103+
public static function provideCompletionSuggestions()
104104
{
105105
yield 'option --format' => [
106106
['--format', ''],

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
@@ -194,7 +194,7 @@ public function testCorrectCacheControlHeadersForCacheableAction($config, $insul
194194
$this->assertSame('public, s-maxage=100', $response->headers->get('cache-control'));
195195
}
196196

197-
public function getConfigs()
197+
public static function getConfigs()
198198
{
199199
return [
200200
// 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
@@ -177,7 +177,7 @@ public function testResourceFilesOptionLoadsBeforeOtherAddedResources($debug, $e
177177
$translator->trans('some_message', [], null, 'some_locale');
178178
}
179179

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

0 commit comments

Comments
 (0)