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

TopologyTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Tests\CustomerGauge\Password\Rule;
4
5
use PHPUnit\Framework\TestCase;
6
use CustomerGauge\Password\Rule\Topology;
7
use CustomerGauge\Password\Exception\InvalidPassword;
8
9
class TopologyTest extends TestCase
10
{
11
    /**
12
     * @dataProvider topologies
13
     */
14
    public function test_it_can_validate_a_topology($format, $password)
15
    {
16
        self::expectException(InvalidPassword::class);
17
18
        $topology = new Topology($format); 
19
20
        $topology($password);
21
    }
22
23
    public function topologies()
24
    {
25
        return [
26
            'using lowercase' => ['lll', 'abc'],
27
            'using uppercase' => ['uuu', 'ABC'],
28
            'using digits'    => ['ddd', '123'],
29
            'using symbols'   => ['sss', '!@#'],
30
            'using mixed'     => ['ulds', 'Ab1!'],
31
        ];
32
    } 
33
}
34