fix: don't enforce required checks on users with administrative roles

This commit is contained in:
Björn Fromme committed 2026-03-15 12:42:28 +01:00
1 parent 3d71dcfc14
commit 90dda38c0f
6 files changed
+62 -17

No files matched your search

@@ -20,12 +20,24 @@ class DriverLicenseRequiredCheckTest extends TestCase
}
public function testAppliesToMixedRoleUsersWithTeamerRole(): void
/**
* @dataProvider mixedRoleProvider
*/
public function testDoesNotApplyToExcludedMixedRoleUsersWithTeamerRole(string $excludedRole): void
{
$user = $this->createTeamerUser();
$user->setRoles(['ROLE_ADMIN', 'ROLE_TEAMER']);
$user->setRoles([$excludedRole, 'ROLE_TEAMER']);
$this->assertTrue($this->check->appliesTo($user));
$this->assertFalse($this->check->appliesTo($user));
}
public function mixedRoleProvider(): array
{
return [
['ROLE_ADMIN'],
['ROLE_MANAGER'],
['ROLE_HOUSE_MANAGER'],
];
}
public function testIsNotSatisfiedWhenDeclarationIsMissing(): void