| 1 | <?php |
||
| 9 | class UsernameTest extends TestCase |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @dataProvider usernames |
||
| 13 | */ |
||
| 14 | public function test_it_can_validate_a_username($password, $username) |
||
| 15 | { |
||
| 16 | self::expectException(InvalidPassword::class); |
||
| 17 | |||
| 18 | $blacklist = new Username([$username]); |
||
| 19 | |||
| 20 | $blacklist($password); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function usernames() |
||
| 24 | { |
||
| 25 | return [ |
||
| 26 | 'Same username' => ['username', 'username'], |
||
| 27 | 'Inicial username part' => ['user123', 'username'], |
||
| 28 | ]; |
||
| 29 | } |
||
| 30 | } |
||
| 31 |