From e0ae37745a85cb08fd24f178d588a8659726f907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 25 Aug 2020 17:12:27 +0200 Subject: Do not expose direct editing if no master key is available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/lib/DirectEditing/ManagerTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/lib/DirectEditing/ManagerTest.php b/tests/lib/DirectEditing/ManagerTest.php index 84685d3a16b..73bb4a836d8 100644 --- a/tests/lib/DirectEditing/ManagerTest.php +++ b/tests/lib/DirectEditing/ManagerTest.php @@ -10,6 +10,7 @@ use OCP\AppFramework\Http\Response; use OCP\DirectEditing\ACreateEmpty; use OCP\DirectEditing\IEditor; use OCP\DirectEditing\IToken; +use OCP\Encryption\IManager; use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\IDBConnection; @@ -104,6 +105,10 @@ class ManagerTest extends TestCase { * @var MockObject|Folder */ private $userFolder; + /** + * @var MockObject|IManager + */ + private $encryptionManager; protected function setUp(): void { parent::setUp(); @@ -116,6 +121,7 @@ class ManagerTest extends TestCase { $this->rootFolder = $this->createMock(IRootFolder::class); $this->userFolder = $this->createMock(Folder::class); $this->l10n = $this->createMock(IL10N::class); + $this->encryptionManager = $this->createMock(IManager::class); $l10nFactory = $this->createMock(IFactory::class); $l10nFactory->expects($this->once()) @@ -128,7 +134,7 @@ class ManagerTest extends TestCase { ->willReturn($this->userFolder); $this->manager = new Manager( - $this->random, $this->connection, $this->userSession, $this->rootFolder, $l10nFactory + $this->random, $this->connection, $this->userSession, $this->rootFolder, $l10nFactory, $this->encryptionManager ); $this->manager->registerDirectEditor($this->editor); -- cgit v1.2.3