diff --git a/tests/unit/Auth/Validator/PasswordDictionaryTest.php b/tests/unit/Auth/Validator/PasswordDictionaryTest.php new file mode 100644 index 0000000000..ab6cd884a3 --- /dev/null +++ b/tests/unit/Auth/Validator/PasswordDictionaryTest.php @@ -0,0 +1,32 @@ +object = new PasswordDictionary( + ['password' => true, '123456' => true], + new Document([ + 'auths' => [ + 'passwordDictionary' => true + ] + ]) + ); + } + + public function testValues(): void + { + $this->assertEquals($this->object->isValid('1'), false); // to check parent is being called + $this->assertEquals($this->object->isValid('123456'), false); + $this->assertEquals($this->object->isValid('password'), false); + $this->assertEquals($this->object->isValid('myPasswordIsRight'), true); + } +}