| @@ 22-33 (lines=12) @@ | ||
| 19 | } |
|
| 20 | ||
| 21 | /** @test */ |
|
| 22 | public function letterPasswordOnly() |
|
| 23 | {
|
|
| 24 | $pw = new Password(); |
|
| 25 | ||
| 26 | $pw->addCriteria(new Dictionaries\Letter(), new Occurrences\Strict(10)); |
|
| 27 | ||
| 28 | $str = $pw->generate(); |
|
| 29 | ||
| 30 | $this->assertNotEmpty($str); |
|
| 31 | ||
| 32 | $this->assertRegExp('/[a-z]/', $str);
|
|
| 33 | } |
|
| 34 | ||
| 35 | /** @test */ |
|
| 36 | public function alphanumericPasswordOnly() |
|
| @@ 191-202 (lines=12) @@ | ||
| 188 | ||
| 189 | ||
| 190 | /** @test */ |
|
| 191 | public function digitPasswordOnly() |
|
| 192 | {
|
|
| 193 | $pw = new Password(); |
|
| 194 | ||
| 195 | $pw->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(10)); |
|
| 196 | ||
| 197 | $str = $pw->generate(); |
|
| 198 | ||
| 199 | $this->assertNotEmpty($str); |
|
| 200 | ||
| 201 | $this->assertRegExp('/\d{10}/', $str);
|
|
| 202 | } |
|
| 203 | ||
| 204 | /** @test */ |
|
| 205 | public function strictOccurrences() |
|