From 38f341c179b9113c573ebb19a38158ee74b728a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 5 Nov 2024 17:30:42 +0100 Subject: [PATCH] fix(tests): Unregister encryption modules in ViewTest to avoid side effects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was clearing the hooks with the same results before Signed-off-by: Côme Chilliet --- tests/lib/Files/ViewTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 53e5855d0e9..a0723dce6ca 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -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());