Skip to content

Commit

Permalink
chore: add integration test for executeActionsEmail
Browse files Browse the repository at this point in the history
  • Loading branch information
fschmtt committed Jan 17, 2025
1 parent 82f71e2 commit a85e6c7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Integration/Resource/UsersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,26 @@ public function testGetUserCredentials(): void
static::assertNull($user);
}

public function testExecuteActionsEmail(): void
{
$users = $this->getKeycloak()->users();
$username = Uuid::uuid4()->toString();

$users->create('master', new User(
username: $username,
));

$user = $this->searchUserByUsername($username);
static::assertInstanceOf(User::class, $user);

$users->executeActionsEmail('master', $user->getId(), ['UPDATE_PASSWORD']);

$users->delete('master', $user->getId());

$user = $this->searchUserByUsername($username);
static::assertNull($user);
}

private function searchUserByUsername(string $username, string $realm = 'master'): ?User
{
/** @var User|null $user */
Expand Down

0 comments on commit a85e6c7

Please sign in to comment.