diff options
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/tests/EncryptedSizePropagationTest.php | 11 | ||||
-rw-r--r-- | apps/files_sharing/tests/TestCase.php | 4 |
3 files changed, 15 insertions, 4 deletions
diff --git a/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php b/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php index bd64cfc60b4..9750274ff62 100644 --- a/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php +++ b/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php @@ -18,6 +18,7 @@ use OCP\Files\SimpleFS\ISimpleFile; use OCP\IPreview; use OCP\IRequest; use OCP\ISession; +use OCP\Preview\IMimeIconProvider; use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IAttributes; use OCP\Share\IManager; @@ -52,7 +53,8 @@ class PublicPreviewControllerTest extends TestCase { $this->request, $this->shareManager, $this->createMock(ISession::class), - $this->previewManager + $this->previewManager, + $this->createMock(IMimeIconProvider::class), ); } 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; } |