| @@ 21-32 (lines=12) @@ | ||
| 18 | } |
|
| 19 | ||
| 20 | /** @test */ |
|
| 21 | public function letterPasswordOnly() |
|
| 22 | {
|
|
| 23 | $pw = new Password(); |
|
| 24 | ||
| 25 | $pw->addCriteria(new Criterias\Letter(), new Occurences\Strict(10)); |
|
| 26 | ||
| 27 | $str = $pw->generate(); |
|
| 28 | ||
| 29 | $this->assertNotEmpty($str); |
|
| 30 | ||
| 31 | $this->assertRegExp('/[a-z]/', $str);
|
|
| 32 | } |
|
| 33 | ||
| 34 | /** @test */ |
|
| 35 | public function FormatOnly() |
|
| @@ 49-60 (lines=12) @@ | ||
| 46 | } |
|
| 47 | ||
| 48 | /** @test */ |
|
| 49 | public function digitPasswordOnly() |
|
| 50 | {
|
|
| 51 | $pw = new Password(); |
|
| 52 | ||
| 53 | $pw->addCriteria(new Criterias\Digit(), new Occurences\Strict(10)); |
|
| 54 | ||
| 55 | $str = $pw->generate(); |
|
| 56 | ||
| 57 | $this->assertNotEmpty($str); |
|
| 58 | ||
| 59 | $this->assertRegExp('/\d{10}/', $str);
|
|
| 60 | } |
|
| 61 | ||
| 62 | /** @test */ |
|
| 63 | public function strictOccurences() |
|