Skip to content

Commit c0a1e5f

Browse files
Merge branch '6.2' into 6.3
* 6.2: Fix merge Migrate to `static` data providers using `rector/rector`
2 parents 08418ca + fa788ff commit c0a1e5f

21 files changed

+34
-34
lines changed

Tests/Authentication/AuthenticatorManagerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function testAuthenticateRequest($matchingAuthenticatorIndex)
119119
$this->assertTrue($listenerCalled, 'The CheckPassportEvent listener is not called');
120120
}
121121

122-
public function provideMatchingAuthenticatorIndex()
122+
public static function provideMatchingAuthenticatorIndex()
123123
{
124124
yield [0];
125125
yield [1];
@@ -187,7 +187,7 @@ public function testEraseCredentials($eraseCredentials)
187187
$manager->authenticateRequest($this->request);
188188
}
189189

190-
public function provideEraseCredentialsData()
190+
public static function provideEraseCredentialsData()
191191
{
192192
yield [true];
193193
yield [false];

Tests/Authenticator/AbstractLoginFormAuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testSupports(string $loginUrl, Request $request, bool $expected)
3131
$this->assertSame($expected, $authenticator->supports($request));
3232
}
3333

34-
public function provideSupportsData(): iterable
34+
public static function provideSupportsData(): iterable
3535
{
3636
yield [
3737
'/login',

Tests/Authenticator/AccessToken/ChainedAccessTokenExtractorsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testSupport($request)
4848
$this->assertNull($this->authenticator->supports($request));
4949
}
5050

51-
public function provideSupportData(): iterable
51+
public static function provideSupportData(): iterable
5252
{
5353
yield [new Request([], [], [], [], [], ['HTTP_AUTHORIZATION' => 'Bearer VALID_ACCESS_TOKEN'])];
5454
yield [new Request([], [], [], [], [], ['HTTP_AUTHORIZATION' => 'Bearer INVALID_ACCESS_TOKEN'])];
@@ -77,7 +77,7 @@ public function testAuthenticateInvalid($request, $errorMessage, $exceptionType
7777
$this->authenticator->authenticate($request);
7878
}
7979

80-
public function provideInvalidAuthenticateData(): iterable
80+
public static function provideInvalidAuthenticateData(): iterable
8181
{
8282
$request = new Request();
8383
yield [$request, 'Invalid credentials.', BadCredentialsException::class];

Tests/Authenticator/AccessToken/FormEncodedBodyAccessTokenAuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function testAuthenticateInvalid($request, $errorMessage, $exceptionType
9292
$this->authenticator->authenticate($request);
9393
}
9494

95-
public function provideInvalidAuthenticateData(): iterable
95+
public static function provideInvalidAuthenticateData(): iterable
9696
{
9797
$request = new Request();
9898
$request->setMethod(Request::METHOD_GET);

Tests/Authenticator/AccessToken/HeaderAccessTokenAuthenticatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testSupport($request)
4545
$this->assertNull($this->authenticator->supports($request));
4646
}
4747

48-
public function provideSupportData(): iterable
48+
public static function provideSupportData(): iterable
4949
{
5050
yield [new Request([], [], [], [], [], ['HTTP_AUTHORIZATION' => 'Bearer VALID_ACCESS_TOKEN'])];
5151
yield [new Request([], [], [], [], [], ['HTTP_AUTHORIZATION' => 'Bearer INVALID_ACCESS_TOKEN'])];
@@ -61,7 +61,7 @@ public function testSupportsWithCustomTokenType($request, $result)
6161
$this->assertSame($result, $this->authenticator->supports($request));
6262
}
6363

64-
public function provideSupportsWithCustomTokenTypeData(): iterable
64+
public static function provideSupportsWithCustomTokenTypeData(): iterable
6565
{
6666
yield [new Request([], [], [], [], [], ['HTTP_AUTHORIZATION' => 'JWT VALID_ACCESS_TOKEN']), null];
6767
yield [new Request([], [], [], [], [], ['HTTP_AUTHORIZATION' => 'JWT INVALID_ACCESS_TOKEN']), null];
@@ -79,7 +79,7 @@ public function testSupportsWithCustomHeaderParameter($request, $result)
7979
$this->assertSame($result, $this->authenticator->supports($request));
8080
}
8181

82-
public function provideSupportsWithCustomHeaderParameter(): iterable
82+
public static function provideSupportsWithCustomHeaderParameter(): iterable
8383
{
8484
yield [new Request([], [], [], [], [], ['HTTP_X_FOO' => 'Bearer VALID_ACCESS_TOKEN']), null];
8585
yield [new Request([], [], [], [], [], ['HTTP_X_FOO' => 'Bearer INVALID_ACCESS_TOKEN']), null];
@@ -120,7 +120,7 @@ public function testAuthenticateInvalid($request, $errorMessage, $exceptionType
120120
$this->authenticator->authenticate($request);
121121
}
122122

123-
public function provideInvalidAuthenticateData(): iterable
123+
public static function provideInvalidAuthenticateData(): iterable
124124
{
125125
$request = new Request();
126126
yield [$request, 'Invalid credentials.', BadCredentialsException::class];

Tests/Authenticator/AccessToken/QueryAccessTokenAuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function testAuthenticateInvalid($request, $errorMessage, $exceptionType
8888
$this->authenticator->authenticate($request);
8989
}
9090

91-
public function provideInvalidAuthenticateData(): iterable
91+
public static function provideInvalidAuthenticateData(): iterable
9292
{
9393
$request = new Request();
9494
yield [$request, 'Invalid credentials.', BadCredentialsException::class];

Tests/Authenticator/FormLoginAuthenticatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testHandleWhenUsernameLength($username, $ok)
6060
$this->authenticator->authenticate($request);
6161
}
6262

63-
public function provideUsernamesForLength()
63+
public static function provideUsernamesForLength()
6464
{
6565
yield [str_repeat('x', UserBadge::MAX_USERNAME_LENGTH + 1), false];
6666
yield [str_repeat('x', UserBadge::MAX_USERNAME_LENGTH - 1), true];
@@ -126,7 +126,7 @@ public function testHandleNonStringUsernameWithToString($postOnly)
126126
$this->authenticator->authenticate($request);
127127
}
128128

129-
public function postOnlyDataProvider()
129+
public static function postOnlyDataProvider()
130130
{
131131
yield [true];
132132
yield [false];
@@ -171,7 +171,7 @@ public function testSupportsFormOnly(string $contentType, bool $shouldSupport)
171171
$this->assertSame($shouldSupport, $this->authenticator->supports($request));
172172
}
173173

174-
public function provideContentTypes()
174+
public static function provideContentTypes()
175175
{
176176
yield ['application/json', false];
177177
yield ['application/x-www-form-urlencoded', true];

Tests/Authenticator/HttpBasicAuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testHttpBasicServerParametersMissing(array $serverParameters)
6767
$this->assertFalse($this->authenticator->supports($request));
6868
}
6969

70-
public function provideMissingHttpBasicServerParameters()
70+
public static function provideMissingHttpBasicServerParameters()
7171
{
7272
return [
7373
[[]],

Tests/Authenticator/JsonLoginAuthenticatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testSupport($request)
4848
$this->assertTrue($this->authenticator->supports($request));
4949
}
5050

51-
public function provideSupportData()
51+
public static function provideSupportData()
5252
{
5353
yield [new Request([], [], [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json'], '{"username": "dunglas", "password": "foo"}')];
5454

@@ -67,7 +67,7 @@ public function testSupportsWithCheckPath($request, $result)
6767
$this->assertSame($result, $this->authenticator->supports($request));
6868
}
6969

70-
public function provideSupportsWithCheckPathData()
70+
public static function provideSupportsWithCheckPathData()
7171
{
7272
yield [Request::create('/api/login', 'GET', [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json']), true];
7373
yield [Request::create('/login', 'GET', [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json']), false];
@@ -107,7 +107,7 @@ public function testAuthenticateInvalid($request, $errorMessage, $exceptionType
107107
$this->authenticator->authenticate($request);
108108
}
109109

110-
public function provideInvalidAuthenticateData()
110+
public static function provideInvalidAuthenticateData()
111111
{
112112
$request = new Request([], [], [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json']);
113113
yield [$request, 'Invalid JSON.'];
@@ -142,7 +142,7 @@ public function testAuthenticationForEmptyCredentialDeprecation($request)
142142
$this->authenticator->authenticate($request);
143143
}
144144

145-
public function provideEmptyAuthenticateData()
145+
public static function provideEmptyAuthenticateData()
146146
{
147147
$request = new Request([], [], [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json'], '{"username": "", "password": "notempty"}');
148148
yield [$request];

Tests/Authenticator/LoginLinkAuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testSupport(array $options, $request, bool $supported)
5050
$this->assertEquals($supported, $this->authenticator->supports($request));
5151
}
5252

53-
public function provideSupportData()
53+
public static function provideSupportData()
5454
{
5555
yield [['check_route' => '/validate_link'], Request::create('/validate_link?hash=abc123'), true];
5656
yield [['check_route' => '/validate_link'], Request::create('/login?hash=abc123'), false];

Tests/Authenticator/RememberMeAuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testSupports($request, $support)
5151
$this->assertSame($support, $this->authenticator->supports($request));
5252
}
5353

54-
public function provideSupportsData()
54+
public static function provideSupportsData()
5555
{
5656
yield [Request::create('/'), false];
5757

Tests/Authenticator/RemoteUserAuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testAuthenticate(InMemoryUserProvider $userProvider, RemoteUserA
6464
$this->assertTrue($user->isEqualTo($passport->getUser()));
6565
}
6666

67-
public function provideAuthenticators()
67+
public static function provideAuthenticators()
6868
{
6969
$userProvider = new InMemoryUserProvider();
7070
yield [$userProvider, new RemoteUserAuthenticator($userProvider, new TokenStorage(), 'main'), 'REMOTE_USER'];

Tests/EventListener/CheckCredentialsListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testPasswordAuthenticated($password, $passwordValid, $result)
6262
}
6363
}
6464

65-
public function providePasswords()
65+
public static function providePasswords()
6666
{
6767
yield ['ThePa$$word', true, true];
6868
yield ['Invalid', false, false];
@@ -98,7 +98,7 @@ public function testCustomAuthenticated($result)
9898
}
9999
}
100100

101-
public function provideCustomAuthenticatedResults()
101+
public static function provideCustomAuthenticatedResults()
102102
{
103103
yield [true];
104104
yield [false];

Tests/EventListener/CheckRememberMeConditionsListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testSuccessfulLoginWithOptInRequestParameter($optInValue)
8080
$this->assertTrue($passport->getBadge(RememberMeBadge::class)->isEnabled());
8181
}
8282

83-
public function provideRememberMeOptInValues()
83+
public static function provideRememberMeOptInValues()
8484
{
8585
yield ['true'];
8686
yield ['1'];

Tests/EventListener/IsGrantedAttributeListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function testAccessDeniedMessages(string|Expression $attribute, string|ar
249249
}
250250
}
251251

252-
public function getAccessDeniedMessageTests()
252+
public static function getAccessDeniedMessageTests()
253253
{
254254
yield ['ROLE_ADMIN', null, 'admin', 0, 'Access Denied by #[IsGranted("ROLE_ADMIN")] on controller'];
255255
yield ['ROLE_ADMIN', 'bar', 'withSubject', 2, 'Access Denied by #[IsGranted("ROLE_ADMIN", "arg2Name")] on controller'];

Tests/EventListener/UserProviderListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testNotOverrideUserLoader($passport)
5353
$this->assertEquals($passport->hasBadge(UserBadge::class) ? $passport->getBadge(UserBadge::class) : null, $badgeBefore);
5454
}
5555

56-
public function provideCompletePassports()
56+
public static function provideCompletePassports()
5757
{
5858
yield [new SelfValidatingPassport(new UserBadge('wouter', function () {}))];
5959
}

Tests/Firewall/ContextListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function testInvalidTokenInSession($token)
156156
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST));
157157
}
158158

159-
public function provideInvalidToken()
159+
public static function provideInvalidToken()
160160
{
161161
return [
162162
['foo'],

Tests/Firewall/ExceptionListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testAuthenticationExceptionWithEntryPoint(\Exception $exception)
6464
$this->assertSame($exception, $event->getThrowable());
6565
}
6666

67-
public function getAuthenticationExceptionProvider()
67+
public static function getAuthenticationExceptionProvider()
6868
{
6969
return [
7070
[$e = new AuthenticationException(), new HttpException(Response::HTTP_UNAUTHORIZED, '', $e, [], 0)],
@@ -192,7 +192,7 @@ public function testUnregister()
192192
$this->assertEmpty($dispatcher->getListeners());
193193
}
194194

195-
public function getAccessDeniedExceptionProvider()
195+
public static function getAccessDeniedExceptionProvider()
196196
{
197197
return [
198198
[new AccessDeniedException()],

Tests/Firewall/LogoutListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function testCsrfValidationFails($invalidToken)
163163
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST));
164164
}
165165

166-
public function provideInvalidCsrfTokens(): array
166+
public static function provideInvalidCsrfTokens(): array
167167
{
168168
return [
169169
['invalid'],

Tests/HttpUtilsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testCreateRedirectResponseWithBadRequestsDomain($url)
6969
$this->assertTrue($response->isRedirect('http://localhost/'));
7070
}
7171

72-
public function badRequestDomainUrls()
72+
public static function badRequestDomainUrls()
7373
{
7474
return [
7575
['http://pirate.net/foo'],
@@ -175,7 +175,7 @@ public function testCreateRequestPassesSecurityRequestAttributesToTheNewRequest(
175175
$this->assertSame('foo', $subRequest->attributes->get($attribute));
176176
}
177177

178-
public function provideSecurityRequestAttributes()
178+
public static function provideSecurityRequestAttributes()
179179
{
180180
return [
181181
[SecurityRequestAttributes::AUTHENTICATION_ERROR],

Tests/LoginLink/LoginLinkHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function testCreateLoginLink($user, array $extraProperties, Request $requ
8888
$this->assertSame('https://example.com/login/verify?user=weaverryan&hash=abchash&expires=1601235000', $loginLink->getUrl());
8989
}
9090

91-
public function provideCreateLoginLinkData()
91+
public static function provideCreateLoginLinkData()
9292
{
9393
yield [
9494
new TestLoginLinkHandlerUser('weaverryan', 'ryan@symfonycasts.com', 'pwhash'),

0 commit comments

Comments
 (0)