Skip to content

Commit 42ae624

Browse files
OskarStarknicolas-grekas
authored andcommitted
Migrate to static data providers using rector/rector
1 parent 559bf2a commit 42ae624

20 files changed

+31
-31
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
@@ -30,7 +30,7 @@ public function testSupports(string $loginUrl, Request $request, bool $expected)
3030
$this->assertSame($expected, $authenticator->supports($request));
3131
}
3232

33-
public function provideSupportsData(): iterable
33+
public static function provideSupportsData(): iterable
3434
{
3535
yield [
3636
'/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', Security::MAX_USERNAME_LENGTH + 1), false];
6666
yield [str_repeat('x', Security::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
@@ -45,7 +45,7 @@ public function testSupport($request)
4545
$this->assertTrue($this->authenticator->supports($request));
4646
}
4747

48-
public function provideSupportData()
48+
public static function provideSupportData()
4949
{
5050
yield [new Request([], [], [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json'], '{"username": "dunglas", "password": "foo"}')];
5151

@@ -64,7 +64,7 @@ public function testSupportsWithCheckPath($request, $result)
6464
$this->assertSame($result, $this->authenticator->supports($request));
6565
}
6666

67-
public function provideSupportsWithCheckPathData()
67+
public static function provideSupportsWithCheckPathData()
6868
{
6969
yield [Request::create('/api/login', 'GET', [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json']), true];
7070
yield [Request::create('/login', 'GET', [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json']), false];
@@ -104,7 +104,7 @@ public function testAuthenticateInvalid($request, $errorMessage, $exceptionType
104104
$this->authenticator->authenticate($request);
105105
}
106106

107-
public function provideInvalidAuthenticateData()
107+
public static function provideInvalidAuthenticateData()
108108
{
109109
$request = new Request([], [], [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json']);
110110
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/EntryPoint/RetryAuthenticationEntryPointTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testStart($httpPort, $httpsPort, $request, $expectedUrl)
3333
$this->assertEquals($expectedUrl, $response->headers->get('Location'));
3434
}
3535

36-
public function dataForStart()
36+
public static function dataForStart()
3737
{
3838
if (!class_exists(Request::class)) {
3939
return [[]];

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];

0 commit comments

Comments
 (0)