summaryrefslogtreecommitdiffstats
path: root/tests/lib/Encryption/Keys/StorageTest.php
diff options
context:
space:
mode:
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