Completed
Push — master ( bcf360...98d48e )
by Abdala
03:37
created

UsernameTest::usernames()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Tests\CustomerGauge\Password\Rule;
4
5
use PHPUnit\Framework\TestCase;
6
use CustomerGauge\Password\Rule\Username;
7
use CustomerGauge\Password\Exception\InvalidPassword;
8
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