aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Encryption/Keys/StorageTest.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-01-17 17:47:01 +0100
committerRobin Appelman <robin@icewind.nl>2024-02-01 15:32:33 +0100
commitedaa4363453351641356058a63495f85cda77e02 (patch)
tree5700d5c177409e141f7b7be845477e85b7be1f7c /tests/lib/Encryption/Keys/StorageTest.php
parent82e02a7f9633277c2fb15af9d6d78333294aecc7 (diff)
downloadnextcloud-server-edaa4363453351641356058a63495f85cda77e02.tar.gz
nextcloud-server-edaa4363453351641356058a63495f85cda77e02.zip
add key location to info:file output
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/Encryption/Keys/StorageTest.php')
-rw-r--r--tests/lib/Encryption/Keys/StorageTest.php34
1 files changed, 1 insertions, 33 deletions
diff --git a/tests/lib/Encryption/Keys/StorageTest.php b/tests/lib/Encryption/Keys/StorageTest.php
index a47edb3fdd6..eaef7fbaa54 100644
--- a/tests/lib/Encryption/Keys/StorageTest.php
+++ b/tests/lib/Encryption/Keys/StorageTest.php
@@ -53,6 +53,7 @@ class StorageTest extends TestCase {
$this->util = $this->getMockBuilder('OC\Encryption\Util')
->disableOriginalConstructor()
+ ->setMethodsExcept(['getFileKeyDir'])
->getMock();
$this->view = $this->getMockBuilder(View::class)
@@ -583,39 +584,6 @@ class StorageTest extends TestCase {
$this->assertSame($expected, $args[0]);
}
- /**
- * @dataProvider dataTestGetFileKeyDir
- *
- * @param bool $isSystemWideMountPoint
- * @param string $storageRoot
- * @param string $expected
- */
- public function testGetFileKeyDir($isSystemWideMountPoint, $storageRoot, $expected) {
- $path = '/user1/files/foo/bar.txt';
- $owner = 'user1';
- $relativePath = '/foo/bar.txt';
-
- $this->invokePrivate($this->storage, 'root_dir', [$storageRoot]);
-
- $this->util->expects($this->once())->method('isSystemWideMountPoint')
- ->willReturn($isSystemWideMountPoint);
- $this->util->expects($this->once())->method('getUidAndFilename')
- ->with($path)->willReturn([$owner, $relativePath]);
-
- $this->assertSame($expected,
- $this->invokePrivate($this->storage, 'getFileKeyDir', ['OC_DEFAULT_MODULE', $path])
- );
- }
-
- public function dataTestGetFileKeyDir() {
- return [
- [false, '', '/user1/files_encryption/keys/foo/bar.txt/OC_DEFAULT_MODULE/'],
- [true, '', '/files_encryption/keys/foo/bar.txt/OC_DEFAULT_MODULE/'],
- [false, 'newStorageRoot', '/newStorageRoot/user1/files_encryption/keys/foo/bar.txt/OC_DEFAULT_MODULE/'],
- [true, 'newStorageRoot', '/newStorageRoot/files_encryption/keys/foo/bar.txt/OC_DEFAULT_MODULE/'],
- ];
- }
-
/**
* @dataProvider dataTestBackupUserKeys