|
19 | 19 | use Symfony\Component\Security\Core\User\InMemoryUserProvider;
|
20 | 20 | use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
|
21 | 21 | use Symfony\Component\Security\Http\Authenticator\JsonLoginAuthenticator;
|
| 22 | +use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; |
22 | 23 | use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
|
23 | 24 | use Symfony\Component\Security\Http\HttpUtils;
|
24 | 25 | use Symfony\Component\Translation\Loader\ArrayLoader;
|
@@ -121,9 +122,9 @@ public function provideInvalidAuthenticateData()
|
121 | 122 | $request = new Request([], [], [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json'], '{"username": "dunglas", "password": 1}');
|
122 | 123 | yield [$request, 'The key "password" must be a string.'];
|
123 | 124 |
|
124 |
| - $username = str_repeat('x', AuthenticatorInterface::MAX_USERNAME_LENGTH + 1); |
125 |
| - $request = new Request([], [], [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json'], sprintf('{"username": "%s", "password": 1}', $username)); |
126 |
| - yield [$request, 'Invalid username.', BadCredentialsException::class]; |
| 125 | + $username = str_repeat('x', UserBadge::MAX_USERNAME_LENGTH + 1); |
| 126 | + $request = new Request([], [], [], [], [], ['HTTP_CONTENT_TYPE' => 'application/json'], sprintf('{"username": "%s", "password": "foo"}', $username)); |
| 127 | + yield [$request, 'Username too long.', BadCredentialsException::class]; |
127 | 128 | }
|
128 | 129 |
|
129 | 130 | public function testAuthenticationFailureWithoutTranslator()
|
|
0 commit comments