fix(tests): Unregister encryption modules in ViewTest to avoid side effects

It was clearing the hooks with the same results before

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/48560/head
Côme Chilliet 2024-11-05 17:30:42 +07:00 committed by Côme Chilliet
parent 536ccf144c
commit 38f341c179
1 changed files with 6 additions and 0 deletions

@ -111,6 +111,12 @@ class ViewTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
\OC_Hook::clear();
/* Disable encryption, this is not what we want to test */
$encryptionManager = Server::get(\OCP\Encryption\IManager::class);
$encryptionModules = $encryptionManager->getEncryptionModules();
foreach (array_keys($encryptionModules) as $encryptionModuleId) {
$encryptionManager->unregisterEncryptionModule($encryptionModuleId);
}
Server::get(IUserManager::class)->clearBackends();
Server::get(IUserManager::class)->registerBackend(new \Test\Util\User\Dummy());