diff --git a/apps/user_ldap/lib/Command/TestUserSettings.php b/apps/user_ldap/lib/Command/TestUserSettings.php index 78188332a4211..88524eded02cc 100644 --- a/apps/user_ldap/lib/Command/TestUserSettings.php +++ b/apps/user_ldap/lib/Command/TestUserSettings.php @@ -46,6 +46,12 @@ protected function configure(): void { InputOption::VALUE_REQUIRED, 'A group DN to check if the user is a member or not' ) + ->addOption( + 'clearcache', + null, + InputOption::VALUE_NONE, + 'Clear the cache of the LDAP connection before the beginning of tests' + ) ; } @@ -54,6 +60,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $uid = $input->getArgument('user'); $access = $this->backend->getLDAPAccess($uid); $connection = $access->getConnection(); + if ($input->getOption('clearcache')) { + $connection->clearCache(); + } $configPrefix = $connection->getConfigPrefix(); $knownDn = ''; if ($access->stringResemblesDN($uid)) {