fix: leave house managers who are also team admins or travel managers out of house manager mail
This commit is contained in:
1 parent
f22d1f1199
commit
50ef662dd3
3 files changed
+29
-1
No files matched your search
@@ -80,6 +80,26 @@ class HouseManagerReminderQueryTest extends KernelTestCase
|
||||
$this->assertNotContains($deleted, $reminded);
|
||||
}
|
||||
|
||||
/**
|
||||
* Staff hold the house manager role and hotel codes for testing; a teamer who also runs a
|
||||
* house is a real house manager.
|
||||
*/
|
||||
public function testHouseManagersWhoAreAlsoAdminsOrManagersAreLeftOut(): void
|
||||
{
|
||||
$teamer = $this->houseManager('[email protected]')->setRoles(['ROLE_HOUSE_MANAGER', 'ROLE_TEAMER']);
|
||||
$admin = $this->houseManager('[email protected]')->setRoles(['ROLE_HOUSE_MANAGER', 'ROLE_TEAM_ADMIN']);
|
||||
$manager = $this->houseManager('[email protected]')->setRoles(['ROLE_MANAGER', 'ROLE_HOUSE_MANAGER']);
|
||||
$this->entityManager->flush();
|
||||
|
||||
/** @var UserRepository $repository */
|
||||
$repository = $this->entityManager->getRepository(User::class);
|
||||
$houseManagers = $repository->findActiveHouseManagers();
|
||||
|
||||
$this->assertContains($teamer, $houseManagers);
|
||||
$this->assertNotContains($admin, $houseManagers);
|
||||
$this->assertNotContains($manager, $houseManagers);
|
||||
}
|
||||
|
||||
private function houseManager(string $email): User
|
||||
{
|
||||
$teamer = (new Teamer())->setFirstName('Hanna')->setLastName('Haus')->setGender('d');
|
||||
|
||||
Reference in new issue
Block a user