2016-04-20 14:58:43 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2024-06-06 19:48:28 +02:00
|
|
|
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2016-04-20 14:58:43 +02:00
|
|
|
*/
|
2016-05-17 11:42:03 +02:00
|
|
|
namespace OCA\Files_Sharing\Tests;
|
2016-04-20 14:58:43 +02:00
|
|
|
|
|
|
|
use OC\Files\View;
|
2025-02-03 15:34:01 +01:00
|
|
|
use OCP\ITempManager;
|
|
|
|
use OCP\Server;
|
2016-04-20 14:58:43 +02:00
|
|
|
use Test\Traits\EncryptionTrait;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group DB
|
|
|
|
*/
|
2016-05-17 11:42:03 +02:00
|
|
|
class EncryptedSizePropagationTest extends SizePropagationTest {
|
2016-04-20 14:58:43 +02:00
|
|
|
use EncryptionTrait;
|
|
|
|
|
2025-05-13 13:11:37 +02:00
|
|
|
protected function setUp(): void {
|
|
|
|
parent::setUp();
|
2024-11-28 12:08:57 +01:00
|
|
|
$this->config->setAppValue('encryption', 'useMasterKey', '0');
|
2025-05-13 13:11:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function setupUser($name, $password = '') {
|
2016-04-20 14:58:43 +02:00
|
|
|
$this->createUser($name, $password);
|
2025-02-03 15:34:01 +01:00
|
|
|
$tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder();
|
2016-04-20 14:58:43 +02:00
|
|
|
$this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]);
|
|
|
|
$this->setupForUser($name, $password);
|
|
|
|
$this->loginWithEncryption($name);
|
|
|
|
return new View('/' . $name . '/files');
|
|
|
|
}
|
2024-11-28 12:08:57 +01:00
|
|
|
|
|
|
|
protected function loginHelper($user, $create = false, $password = false) {
|
|
|
|
$this->setupForUser($user, $password);
|
|
|
|
parent::loginHelper($user, $create, $password);
|
|
|
|
}
|
2016-04-20 14:58:43 +02:00
|
|
|
}
|