From 6028127c0d0a6fca8194a55258fa149f09d708f8 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 2a74558c70d1c..cea791ab90584 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -98,6 +98,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); + } \OC_User::clearBackends(); \OC_User::useBackend(new \Test\Util\User\Dummy());