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