Skip to content

Commit

Permalink
UHF-10169: Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Jun 24, 2024
1 parent 5bda2cc commit a4e4e49
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/src/Kernel/RoleMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, ['amr' => ['something'], 'userinfo' => ['ad_groups' => []]]);
// 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.
Expand Down

0 comments on commit a4e4e49

Please sign in to comment.