Skip to content

Commit f4ea109

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

13 files changed

+29
-29
lines changed

Tests/DependencyInjection/Compiler/RegisterGlobalSecurityEventListenersPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testEventIsPropagated(string $configuredEvent, string $registere
7070
]);
7171
}
7272

73-
public function providePropagatedEvents(): array
73+
public static function providePropagatedEvents(): array
7474
{
7575
return [
7676
[CheckPassportEvent::class, CheckPassportEvent::class],

Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function testDefaultFailureHandler($serviceId, $defaultHandlerInjection)
8686
}
8787
}
8888

89-
public function getFailureHandlers()
89+
public static function getFailureHandlers()
9090
{
9191
return [
9292
[null, true],
@@ -135,7 +135,7 @@ public function testDefaultSuccessHandler($serviceId, $defaultHandlerInjection)
135135
}
136136
}
137137

138-
public function getSuccessHandlers()
138+
public static function getSuccessHandlers()
139139
{
140140
return [
141141
[null, true],

Tests/DependencyInjection/Security/Factory/GuardAuthenticationFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testAddInvalidConfiguration(array $inputConfig)
5454
$node->finalize($normalizedConfig);
5555
}
5656

57-
public function getValidConfigurationTests()
57+
public static function getValidConfigurationTests()
5858
{
5959
$tests = [];
6060

@@ -86,7 +86,7 @@ public function getValidConfigurationTests()
8686
return $tests;
8787
}
8888

89-
public function getInvalidConfigurationTests()
89+
public static function getInvalidConfigurationTests()
9090
{
9191
$tests = [];
9292

Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ public function testSecretRememberMeHandler()
525525
$this->assertSame('very', $handler->getArgument(1));
526526
}
527527

528-
public function sessionConfigurationProvider()
528+
public static function sessionConfigurationProvider()
529529
{
530530
return [
531531
[
@@ -546,7 +546,7 @@ public function sessionConfigurationProvider()
546546
];
547547
}
548548

549-
public function acceptableIpsProvider(): iterable
549+
public static function acceptableIpsProvider(): iterable
550550
{
551551
yield [['127.0.0.1']];
552552
yield ['127.0.0.1'];
@@ -657,7 +657,7 @@ public function testAuthenticatorManagerEnabledEntryPoint(array $firewall, $entr
657657
$this->assertEquals($entryPointId, (string) $container->getDefinition('security.exception_listener.main')->getArgument(4));
658658
}
659659

660-
public function provideEntryPointFirewalls()
660+
public static function provideEntryPointFirewalls()
661661
{
662662
// only one entry point available
663663
yield [['http_basic' => true], 'security.authenticator.http_basic.main'];
@@ -697,7 +697,7 @@ public function testEntryPointRequired(array $firewall, $messageRegex)
697697
$container->compile();
698698
}
699699

700-
public function provideEntryPointRequiredData()
700+
public static function provideEntryPointRequiredData()
701701
{
702702
// more than one entry point available and not explicitly set
703703
yield [
@@ -747,7 +747,7 @@ public function testConfigureCustomAuthenticator(array $firewall, array $expecte
747747
$this->assertEquals($expectedAuthenticators, array_map('strval', $container->getDefinition('security.authenticator.manager.main')->getArgument(0)));
748748
}
749749

750-
public function provideConfigureCustomAuthenticatorData()
750+
public static function provideConfigureCustomAuthenticatorData()
751751
{
752752
yield [
753753
['custom_authenticator' => TestAuthenticator::class],
@@ -827,7 +827,7 @@ public function testUserCheckerWithAuthenticatorManager(array $config, string $e
827827
$this->assertEquals($expectedUserCheckerClass, $container->findDefinition($userCheckerId)->getClass());
828828
}
829829

830-
public function provideUserCheckerConfig()
830+
public static function provideUserCheckerConfig()
831831
{
832832
yield [[], InMemoryUserChecker::class];
833833
yield [['user_checker' => TestUserChecker::class], TestUserChecker::class];

Tests/Functional/AuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testWithoutUserProvider($email)
6060
$this->assertJsonStringEqualsJsonString('{"email":"'.$email.'"}', $client->getResponse()->getContent());
6161
}
6262

63-
public function provideEmails()
63+
public static function provideEmails()
6464
{
6565
yield ['[email protected]', true];
6666
yield ['[email protected]', false];
@@ -84,7 +84,7 @@ public function testLoginUsersWithMultipleFirewalls(string $username, string $fi
8484
$this->assertEquals('Welcome '.$username.'!', $client->getResponse()->getContent());
8585
}
8686

87-
public function provideEmailsWithFirewalls()
87+
public static function provideEmailsWithFirewalls()
8888
{
8989
yield ['[email protected]', 'main'];
9090
yield ['[email protected]', 'custom'];

Tests/Functional/CsrfFormLoginTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,13 @@ public function testLegacyFormLoginRedirectsToProtectedResourceAfterLogin($optio
213213
$this->assertStringContainsString('You\'re browsing to path "/protected-resource".', $text);
214214
}
215215

216-
public function provideClientOptions()
216+
public static function provideClientOptions()
217217
{
218218
yield [['test_case' => 'CsrfFormLogin', 'root_config' => 'config.yml', 'enable_authenticator_manager' => true]];
219219
yield [['test_case' => 'CsrfFormLogin', 'root_config' => 'routes_as_path.yml', 'enable_authenticator_manager' => true]];
220220
}
221221

222-
public function provideLegacyClientOptions()
222+
public static function provideLegacyClientOptions()
223223
{
224224
yield [['test_case' => 'CsrfFormLogin', 'root_config' => 'legacy_config.yml', 'enable_authenticator_manager' => false]];
225225
yield [['test_case' => 'CsrfFormLogin', 'root_config' => 'legacy_routes_as_path.yml', 'enable_authenticator_manager' => false]];

Tests/Functional/FormLoginTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,13 @@ public function testLegacyLoginThrottling()
296296
}
297297
}
298298

299-
public function provideClientOptions()
299+
public static function provideClientOptions()
300300
{
301301
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'base_config.yml', 'enable_authenticator_manager' => true]];
302302
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'routes_as_path.yml', 'enable_authenticator_manager' => true]];
303303
}
304304

305-
public function provideLegacyClientOptions()
305+
public static function provideLegacyClientOptions()
306306
{
307307
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'legacy_config.yml', 'enable_authenticator_manager' => false]];
308308
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'legacy_routes_as_path.yml', 'enable_authenticator_manager' => false]];

Tests/Functional/LocalizedRoutesAsPathTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ public function testLegacyAccessRestrictedResourceWithForward($locale, array $op
137137
$this->assertCount(1, $crawler->selectButton('login'), (string) $client->getResponse());
138138
}
139139

140-
public function getLocalesAndClientConfig()
140+
public static function getLocalesAndClientConfig()
141141
{
142142
yield ['en', ['root_config' => 'localized_routes.yml']];
143143
yield ['de', ['root_config' => 'localized_routes.yml']];
144144
}
145145

146-
public function getLegacyLocalesAndClientConfig()
146+
public static function getLegacyLocalesAndClientConfig()
147147
{
148148
yield ['en', ['root_config' => 'legacy_localized_routes.yml']];
149149
yield ['de', ['root_config' => 'legacy_localized_routes.yml']];

Tests/Functional/RememberMeCookieTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testLegacySessionRememberMeSecureCookieFlagAuto($https, $expecte
5050
$this->assertSame($expectedSecureFlag, $cookies['']['/']['REMEMBERME']->isSecure());
5151
}
5252

53-
public function getSessionRememberMeSecureCookieFlagAutoHttpsMap()
53+
public static function getSessionRememberMeSecureCookieFlagAutoHttpsMap()
5454
{
5555
return [
5656
[true, true],

Tests/Functional/RememberMeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ public function testLegacySessionLessRememberMeLogout()
174174
$this->assertNull($cookieJar->get('REMEMBERME'));
175175
}
176176

177-
public function provideConfigs()
177+
public static function provideConfigs()
178178
{
179179
yield [['root_config' => 'config_session.yml']];
180180
yield [['root_config' => 'config_persistent.yml']];
181181
}
182182

183-
public function provideLegacyConfigs()
183+
public static function provideLegacyConfigs()
184184
{
185185
yield [['root_config' => 'legacy_config_session.yml']];
186186
yield [['root_config' => 'legacy_config_persistent.yml']];

Tests/Functional/SecurityRoutingIntegrationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,25 +289,25 @@ private function assertRestricted($client, $path)
289289
$this->assertEquals(302, $client->getResponse()->getStatusCode());
290290
}
291291

292-
public function provideClientOptions()
292+
public static function provideClientOptions()
293293
{
294294
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'base_config.yml', 'enable_authenticator_manager' => true]];
295295
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'routes_as_path.yml', 'enable_authenticator_manager' => true]];
296296
}
297297

298-
public function provideLegacyClientOptions()
298+
public static function provideLegacyClientOptions()
299299
{
300300
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'base_config.yml', 'enable_authenticator_manager' => true]];
301301
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'routes_as_path.yml', 'enable_authenticator_manager' => true]];
302302
}
303303

304-
public function provideConfigs()
304+
public static function provideConfigs()
305305
{
306306
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'base_config.yml']];
307307
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'routes_as_path.yml']];
308308
}
309309

310-
public function provideLegacyConfigs()
310+
public static function provideLegacyConfigs()
311311
{
312312
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'legacy_config.yml']];
313313
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'legacy_routes_as_path.yml']];

Tests/Functional/SecurityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function testLegacyServiceIsFunctional()
113113
$this->assertSame($token, $security->getToken());
114114
}
115115

116-
public function userWillBeMarkedAsChangedIfRolesHasChangedProvider()
116+
public static function userWillBeMarkedAsChangedIfRolesHasChangedProvider()
117117
{
118118
return [
119119
[

Tests/Functional/SwitchUserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function testSwitchUserStateless(array $options)
8585
$this->assertSame('dunglas', $client->getProfile()->getCollector('security')->getUser());
8686
}
8787

88-
public function getTestParameters()
88+
public static function getTestParameters()
8989
{
9090
return [
9191
'unauthorized_user_cannot_switch' => ['user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403],
@@ -95,7 +95,7 @@ public function getTestParameters()
9595
];
9696
}
9797

98-
public function getLegacyTestParameters()
98+
public static function getLegacyTestParameters()
9999
{
100100
return [
101101
'legacy_unauthorized_user_cannot_switch' => ['user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403],

0 commit comments

Comments
 (0)