|
22 | 22 | final class FindUserByUsernameTraitTest extends TestCase |
23 | 23 | { |
24 | 24 | /** |
25 | | - * @return iterable<string, array{string, bool}> |
| 25 | + * @return iterable<string, array{string, string, bool}> |
26 | 26 | */ |
27 | 27 | public static function usernames(): iterable |
28 | 28 | { |
29 | | - yield 'the username' => ['my_username', true]; |
30 | | - yield 'the username in capitals with surrounding space' => [' MY_USERNAME ', true]; |
31 | | - yield 'the email address the identifier also matches' => ['user@example.com', false]; |
| 29 | + yield 'the username' => ['my_username', 'my_username', true]; |
| 30 | + yield 'the username in capitals with surrounding space' => ['my_username', ' MY_USERNAME ', true]; |
| 31 | + yield 'a username stored in capitals' => ['My_Username', 'my_username', true]; |
| 32 | + yield 'the email address the identifier also matches' => ['my_username', 'user@example.com', false]; |
32 | 33 | } |
33 | 34 |
|
34 | 35 | #[DataProvider('usernames')] |
35 | | - public function test_only_the_users_own_username_finds_them(string $username, bool $found): void |
| 36 | + public function test_only_the_users_own_username_finds_them(string $storedUsername, string $username, bool $found): void |
36 | 37 | { |
37 | | - $user = new User('my_username', 'user@example.com'); |
| 38 | + $user = new User($storedUsername, 'user@example.com'); |
38 | 39 | $repository = $this->createStub(UserRepositoryInterface::class); |
39 | 40 | $repository->method('loadUserByIdentifier')->willReturn($user); |
40 | 41 |
|
|
0 commit comments