|
@@ 237-247 (lines=11) @@
|
| 234 |
|
} |
| 235 |
|
|
| 236 |
|
/** @test */ |
| 237 |
|
public function simpleStrictPerfectScore() |
| 238 |
|
{ |
| 239 |
|
$string = '1a2b3c'; |
| 240 |
|
|
| 241 |
|
$password = new Password(); |
| 242 |
|
|
| 243 |
|
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(3)); |
| 244 |
|
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Strict(3)); |
| 245 |
|
|
| 246 |
|
$this->assertEquals($password->score($string), 100); |
| 247 |
|
} |
| 248 |
|
|
| 249 |
|
/** @test */ |
| 250 |
|
public function simpleBetweenPerfectScore() |
|
@@ 250-260 (lines=11) @@
|
| 247 |
|
} |
| 248 |
|
|
| 249 |
|
/** @test */ |
| 250 |
|
public function simpleBetweenPerfectScore() |
| 251 |
|
{ |
| 252 |
|
$string = '1a2b3c4'; |
| 253 |
|
|
| 254 |
|
$password = new Password(); |
| 255 |
|
|
| 256 |
|
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Between(3, 5)); |
| 257 |
|
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Between(3, 5)); |
| 258 |
|
|
| 259 |
|
$this->assertEquals($password->score($string), 100); |
| 260 |
|
} |
| 261 |
|
|
| 262 |
|
/** @test */ |
| 263 |
|
public function simpleMixedPerfectScore() |
|
@@ 263-273 (lines=11) @@
|
| 260 |
|
} |
| 261 |
|
|
| 262 |
|
/** @test */ |
| 263 |
|
public function simpleMixedPerfectScore() |
| 264 |
|
{ |
| 265 |
|
$string = '1a2b3cde'; |
| 266 |
|
|
| 267 |
|
$password = new Password(); |
| 268 |
|
|
| 269 |
|
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(3)); |
| 270 |
|
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Between(3, 5)); |
| 271 |
|
|
| 272 |
|
$this->assertEquals($password->score($string), 100); |
| 273 |
|
} |
| 274 |
|
|
| 275 |
|
/** @test */ |
| 276 |
|
public function simpleMixedIncompleteScore() |
|
@@ 276-286 (lines=11) @@
|
| 273 |
|
} |
| 274 |
|
|
| 275 |
|
/** @test */ |
| 276 |
|
public function simpleMixedIncompleteScore() |
| 277 |
|
{ |
| 278 |
|
$string = '1a2bc'; |
| 279 |
|
|
| 280 |
|
$password = new Password(); |
| 281 |
|
|
| 282 |
|
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(3)); |
| 283 |
|
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Between(3, 5)); |
| 284 |
|
|
| 285 |
|
$this->assertEquals($password->score($string), 50); |
| 286 |
|
} |
| 287 |
|
|
| 288 |
|
/** @test */ |
| 289 |
|
public function complexStrictPerfectScore() |