Skip to content

Commit

Permalink
test(user): Ensure user_dn_hash is emptied when user_dn is set to emp…
Browse files Browse the repository at this point in the history
…ty or null
  • Loading branch information
ccailly committed Dec 21, 2023
1 parent 70983fa commit c55200b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/functional/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,20 @@ public function testUserDnIsHashedOnAddAndUpdate(): void
]);
$user->getFromDB($user->getID());
$this->string($user->fields['user_dn_hash'])->isEqualTo(md5($dn));

// Set user_dn to empty and check that user_dn_hash is set to null
$this->updateItem('User', $user->getID(), [
'user_dn' => ''
]);
$user->getFromDB($user->getID());
$this->variable($user->fields['user_dn_hash'])->isNull();

// Set user_dn to null and check that user_dn_hash is set to null
$this->updateItem('User', $user->getID(), [
'user_dn' => null
]);
$user->getFromDB($user->getID());
$this->variable($user->fields['user_dn_hash'])->isNull();
}

/**
Expand Down

0 comments on commit c55200b

Please sign in to comment.