|
@@ 291-305 (lines=15) @@
|
| 288 |
|
} |
| 289 |
|
|
| 290 |
|
/** @test */ |
| 291 |
|
public function complexStrictPerfectScore() |
| 292 |
|
{ |
| 293 |
|
$string = '123abcABC[&+àáâÀÁÂ'; |
| 294 |
|
|
| 295 |
|
$password = new Password(); |
| 296 |
|
|
| 297 |
|
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(3)); |
| 298 |
|
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Strict(3)); |
| 299 |
|
$password->addCriteria(new Dictionaries\UppercaseLetter(), new Occurrences\Strict(3)); |
| 300 |
|
$password->addCriteria(new Dictionaries\SpecialCharacter(), new Occurrences\Strict(3)); |
| 301 |
|
$password->addCriteria(new Dictionaries\AccentedLetter(), new Occurrences\Strict(3)); |
| 302 |
|
$password->addCriteria(new Dictionaries\AccentedUppercaseLetter(), new Occurrences\Strict(3)); |
| 303 |
|
|
| 304 |
|
$this->assertEquals($password->score($string), 100); |
| 305 |
|
} |
| 306 |
|
|
| 307 |
|
/** @test */ |
| 308 |
|
public function complexStrictIncompleteScore() |
|
@@ 308-322 (lines=15) @@
|
| 305 |
|
} |
| 306 |
|
|
| 307 |
|
/** @test */ |
| 308 |
|
public function complexStrictIncompleteScore() |
| 309 |
|
{ |
| 310 |
|
$string = '12abcAB[&+àáâÀÁÂ'; |
| 311 |
|
|
| 312 |
|
$password = new Password(); |
| 313 |
|
|
| 314 |
|
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(3)); |
| 315 |
|
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Strict(3)); |
| 316 |
|
$password->addCriteria(new Dictionaries\UppercaseLetter(), new Occurrences\Strict(3)); |
| 317 |
|
$password->addCriteria(new Dictionaries\SpecialCharacter(), new Occurrences\Strict(3)); |
| 318 |
|
$password->addCriteria(new Dictionaries\AccentedLetter(), new Occurrences\Strict(3)); |
| 319 |
|
$password->addCriteria(new Dictionaries\AccentedUppercaseLetter(), new Occurrences\Strict(3)); |
| 320 |
|
|
| 321 |
|
$this->assertEquals($password->score($string), 67); |
| 322 |
|
} |
| 323 |
|
|
| 324 |
|
/** @test */ |
| 325 |
|
public function complexMixedPerfectScore() |
|
@@ 325-339 (lines=15) @@
|
| 322 |
|
} |
| 323 |
|
|
| 324 |
|
/** @test */ |
| 325 |
|
public function complexMixedPerfectScore() |
| 326 |
|
{ |
| 327 |
|
$string = '123abcdEFG[&+éèàÒÓÔ'; |
| 328 |
|
|
| 329 |
|
$password = new Password(); |
| 330 |
|
|
| 331 |
|
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(3)); |
| 332 |
|
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Between(3, 5)); |
| 333 |
|
$password->addCriteria(new Dictionaries\UppercaseLetter(), new Occurrences\Strict(3)); |
| 334 |
|
$password->addCriteria(new Dictionaries\SpecialCharacter(), new Occurrences\Between(3, 5)); |
| 335 |
|
$password->addCriteria(new Dictionaries\AccentedLetter(), new Occurrences\Strict(3)); |
| 336 |
|
$password->addCriteria(new Dictionaries\AccentedUppercaseLetter(), new Occurrences\Between(3, 5)); |
| 337 |
|
|
| 338 |
|
$this->assertEquals($password->score($string), 100); |
| 339 |
|
} |
| 340 |
|
|
| 341 |
|
/** @test */ |
| 342 |
|
public function checkLettersParticularities() |