From 674d6341637b56f43f298c4052144445845013ca Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Mon, 24 Jun 2024 14:46:46 +0300 Subject: [PATCH] UHF-10169: Add tests --- tests/src/Kernel/RoleMapTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/src/Kernel/RoleMapTest.php b/tests/src/Kernel/RoleMapTest.php index ffdc675..7cff818 100644 --- a/tests/src/Kernel/RoleMapTest.php +++ b/tests/src/Kernel/RoleMapTest.php @@ -28,6 +28,13 @@ public function testRoleMap() : void { // Create a new role and tell our plugin to map the role. $role = $this->createRole([], 'test'); $this->setPluginConfiguration('client_roles', [$role => $role]); + $this->setPluginConfiguration('ad_roles_disabled_amr', ['something']); + + $this->getPlugin()->mapRoles($account, ['userinfo' => ['ad_groups' => [], 'amr' => ['something']]]); + // Our account should not have the newly added role now, amr is disabled. + $this->assertEquals([ + AccountInterface::AUTHENTICATED_ROLE, + ], $account->getRoles()); $this->getPlugin()->mapRoles($account, ['userinfo' => ['ad_groups' => []]]); // Our account should have the newly added role now.