Completed
Pull Request — master (#2)
by
unknown
01:37
created

Test::emptyPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
use DeGraciaMathieu\Riddler\Password;
4
use DeGraciaMathieu\Riddler\Criterias;
5
use DeGraciaMathieu\Riddler\Occurences;
6
7
class Test extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
8
{
9
    /** @test */
10
    public function example()
11
    {
12
        return $this->assertTrue(true);
13
    }
14
15
    /** @test */
16
    public function emptyPassword()
17
    {
18
        $pw = new Password();
19
20
        $str = $pw->generate();
21
22
        $this->assertEmpty($str);
23
    }
24
25
    /** @test */
26
    public function digitPasswordOnly()
27
    {
28
        $pw = new Password();
29
30
        $pw->addCriteria(new Criterias\Digit(), new Occurences\Strict(10));
31
32
        $str = $pw->generate();
33
34
        $this->assertNotEmpty($str);
35
36
        $this->assertRegExp('/\d{10}/', $str);
37
    }
38
}
39