fix: don't enforce required checks on users with administrative roles
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user