Files
nextcloud-server-mirror/apps/user_ldap/tests/Mapping/GroupMappingTest.php
Hoang Pham 558ee862f6 fix(user_ldap): do not cache unknown names in the local mapping cache
A web request that looked up a user or group before it was mapped stored
the miss in the local cache for 30 days. Mapping it later from the CLI
(occ ldap:search, the Sync job) does not touch that cache, so web
requests kept treating it as unknown. Only found DNs are cached now, and
a cached miss is ignored.

Fixes #66003

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
2026-11-03 19:39:26 +07:00

29 lines
758 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\User_LDAP\Tests\Mapping;
use OCA\User_LDAP\Mapping\GroupMapping;
use OCP\IAppConfig;
use OCP\ICacheFactory;
use OCP\IDBConnection;
/**
* Class GroupMappingTest
*
*
* @package OCA\User_LDAP\Tests\Mapping
*/
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class GroupMappingTest extends AbstractMappingTestCase {
public function getMapper(IDBConnection $dbMock, ICacheFactory $cacheFactory, IAppConfig $appConfig, bool $isCLI = true): GroupMapping {
return new GroupMapping($dbMock, $cacheFactory, $appConfig, $isCLI);
}
}