major update

This commit is contained in:
2026-03-04 15:56:58 +01:00
parent 16759a2732
commit 8f4dd5840d
478 changed files with 24313 additions and 8201 deletions

View File

@@ -24,4 +24,36 @@ class UserPasswordPolicyServiceTest extends TestCase
$this->assertNotEmpty($errors);
}
public function testValidateRequiresPasswordWhenRequired(): void
{
$service = new UserPasswordPolicyService();
$errors = $service->validate('', '', true, 'test@example.com');
$this->assertNotEmpty($errors);
}
public function testValidateRejectsMismatch(): void
{
$service = new UserPasswordPolicyService();
$errors = $service->validate('Abcd1234$efg', 'Abcd1234$xxx', true, 'test@example.com');
$this->assertNotEmpty($errors);
}
public function testValidateAcceptsStrongPassword(): void
{
$service = new UserPasswordPolicyService();
$errors = $service->validate('StrongPass1!', 'StrongPass1!', true, 'test@example.com');
$this->assertSame([], $errors);
}
public function testValidateRejectsPasswordContainingEmail(): void
{
$service = new UserPasswordPolicyService();
$errors = $service->validate('test@example.comA1!', 'test@example.comA1!', true, 'test@example.com');
$this->assertNotEmpty($errors);
}
}