diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2025-05-14 19:25:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-14 19:25:51 +0200 |
commit | 2cd491f491a658ad906a1a4602f64a4abe9a25bb (patch) | |
tree | e42ac00a3b80197579f4c4ada6ac083c458eb5f8 /apps/files_sharing/tests | |
parent | 42f45030ff282504d7c6d6321e46ce118d5e4087 (diff) | |
parent | 43418eea5f627e1dee61f37c43a47fd00bfba376 (diff) | |
download | nextcloud-server-2cd491f491a658ad906a1a4602f64a4abe9a25bb.tar.gz nextcloud-server-2cd491f491a658ad906a1a4602f64a4abe9a25bb.zip |
Merge pull request #48560 from nextcloud/fix/migrate-encryption-away-from-hooks
feat(encryption): Migrate from hooks to events
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/EncryptedSizePropagationTest.php | 11 | ||||
-rw-r--r-- | apps/files_sharing/tests/TestCase.php | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/EncryptedSizePropagationTest.php b/apps/files_sharing/tests/EncryptedSizePropagationTest.php index 1430e5f17ac..a416cd14715 100644 --- a/apps/files_sharing/tests/EncryptedSizePropagationTest.php +++ b/apps/files_sharing/tests/EncryptedSizePropagationTest.php @@ -17,13 +17,22 @@ use Test\Traits\EncryptionTrait; class EncryptedSizePropagationTest extends SizePropagationTest { use EncryptionTrait; + protected function setUp(): void { + parent::setUp(); + $this->config->setAppValue('encryption', 'useMasterKey', '0'); + } + protected function setupUser($name, $password = '') { $this->createUser($name, $password); $tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder(); $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]); - $this->config->setAppValue('encryption', 'useMasterKey', '0'); $this->setupForUser($name, $password); $this->loginWithEncryption($name); return new View('/' . $name . '/files'); } + + protected function loginHelper($user, $create = false, $password = false) { + $this->setupForUser($user, $password); + parent::loginHelper($user, $create, $password); + } } diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php index 647a591db8d..34e2d71fb02 100644 --- a/apps/files_sharing/tests/TestCase.php +++ b/apps/files_sharing/tests/TestCase.php @@ -108,7 +108,7 @@ abstract class TestCase extends \Test\TestCase { Server::get(DisplayNameCache::class)->clear(); //login as user1 - self::loginHelper(self::TEST_FILES_SHARING_API_USER1); + $this->loginHelper(self::TEST_FILES_SHARING_API_USER1); $this->data = 'foobar'; $this->view = new View('/' . self::TEST_FILES_SHARING_API_USER1 . '/files'); @@ -173,7 +173,7 @@ abstract class TestCase extends \Test\TestCase { * @param bool $create * @param bool $password */ - protected static function loginHelper($user, $create = false, $password = false) { + protected function loginHelper($user, $create = false, $password = false) { if ($password === false) { $password = $user; } |