aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-10-23 13:22:23 +0200
committerRobin Appelman <robin@icewind.nl>2023-11-08 17:34:58 +0100
commitf4fa2fb93cd230a69ae6d6aad6b293b3a576eae7 (patch)
treeb96bd1184ddd128c59b491a89e505a6ba33483ea /tests
parentdec880b285e47207eeebd36b1c512c1d85a18676 (diff)
downloadnextcloud-server-f4fa2fb93cd230a69ae6d6aad6b293b3a576eae7.tar.gz
nextcloud-server-f4fa2fb93cd230a69ae6d6aad6b293b3a576eae7.zip
optimize isShared and isMounted
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/FileInfoTest.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/lib/Files/FileInfoTest.php b/tests/lib/Files/FileInfoTest.php
index fd2b506beb9..98f51aed67d 100644
--- a/tests/lib/Files/FileInfoTest.php
+++ b/tests/lib/Files/FileInfoTest.php
@@ -9,6 +9,8 @@
namespace Test\Files;
use OC\Files\FileInfo;
+use OC\Files\Mount\HomeMountPoint;
+use OC\Files\Mount\MountPoint;
use OC\Files\Storage\Home;
use OC\Files\Storage\Temporary;
use OCP\IConfig;
@@ -33,19 +35,27 @@ class FileInfoTest extends TestCase {
->willReturn('foo');
$user->method('getHome')
->willReturn('foo');
+ $storage = new Home(['user' => $user]);
$fileInfo = new FileInfo(
'',
- new Home(['user' => $user]),
- '', [], null);
+ $storage,
+ '',
+ [],
+ new HomeMountPoint($user, $storage, '/foo/files')
+ );
$this->assertFalse($fileInfo->isMounted());
}
public function testIsMountedNonHomeStorage() {
+ $storage = new Temporary();
$fileInfo = new FileInfo(
'',
- new Temporary(),
- '', [], null);
+ $storage,
+ '',
+ [],
+ new MountPoint($storage, '/foo/files/bar')
+ );
$this->assertTrue($fileInfo->isMounted());
}
}