Skip to content

Commit

Permalink
fix(tests): Unregister encryption modules in ViewTest to avoid side e…
Browse files Browse the repository at this point in the history
…ffects

It was clearing the hooks with the same results before

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Nov 5, 2024
1 parent fc22188 commit 6028127
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/lib/Files/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 6028127

Please sign in to comment.