Skip to content

Commit 17fe51d

Browse files
Merge branch '5.4' into 6.2
* 5.4: Migrate to `static` data providers using `rector/rector`
2 parents e656666 + 42ae624 commit 17fe51d

14 files changed

+21
-21
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];
@@ -189,7 +189,7 @@ public function testEraseCredentials($eraseCredentials)
189189
$manager->authenticateRequest($this->request);
190190
}
191191

192-
public function provideEraseCredentialsData()
192+
public static function provideEraseCredentialsData()
193193
{
194194
yield [true];
195195
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/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: 3 additions & 3 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.'];

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];
@@ -100,7 +100,7 @@ public function testCustomAuthenticated($result)
100100
}
101101
}
102102

103-
public function provideCustomAuthenticatedResults()
103+
public static function provideCustomAuthenticatedResults()
104104
{
105105
yield [true];
106106
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'];

0 commit comments

Comments
 (0)