summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/CapabilitiesTest.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-04-23 17:29:34 +0200
committerRobin Appelman <robin@icewind.nl>2021-05-12 16:11:28 +0200
commitb1dca57a1ce59bacc4089761275e4366e9760313 (patch)
treeed79b9ab833ee9af257dc4f0e68afbd28656043c /apps/files_sharing/tests/CapabilitiesTest.php
parent7e1c842d96cde01ebb6854b3e28fb998006575b2 (diff)
downloadnextcloud-server-b1dca57a1ce59bacc4089761275e4366e9760313.tar.gz
nextcloud-server-b1dca57a1ce59bacc4089761275e4366e9760313.zip
load share settings from the share manager in more places
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/tests/CapabilitiesTest.php')
-rw-r--r--apps/files_sharing/tests/CapabilitiesTest.php37
1 files changed, 36 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/CapabilitiesTest.php b/apps/files_sharing/tests/CapabilitiesTest.php
index fbe8c832c1d..7f019603e32 100644
--- a/apps/files_sharing/tests/CapabilitiesTest.php
+++ b/apps/files_sharing/tests/CapabilitiesTest.php
@@ -27,8 +27,24 @@
namespace OCA\Files_Sharing\Tests;
+use OC\Share20\Manager;
use OCA\Files_Sharing\Capabilities;
+use OCP\EventDispatcher\IEventDispatcher;
+use OCP\Files\IRootFolder;
+use OCP\Files\Mount\IMountManager;
use OCP\IConfig;
+use OCP\IGroupManager;
+use OCP\IL10N;
+use OCP\ILogger;
+use OCP\IURLGenerator;
+use OCP\IUserManager;
+use OCP\IUserSession;
+use OCP\L10N\IFactory;
+use OCP\Mail\IMailer;
+use OCP\Security\IHasher;
+use OCP\Security\ISecureRandom;
+use OCP\Share\IProviderFactory;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Class CapabilitiesTest
@@ -60,7 +76,26 @@ class CapabilitiesTest extends \Test\TestCase {
private function getResults(array $map) {
$config = $this->getMockBuilder(IConfig::class)->disableOriginalConstructor()->getMock();
$config->method('getAppValue')->willReturnMap($map);
- $cap = new Capabilities($config);
+ $shareManager = new Manager(
+ $this->createMock(ILogger::class),
+ $config,
+ $this->createMock(ISecureRandom::class),
+ $this->createMock(IHasher::class),
+ $this->createMock(IMountManager::class),
+ $this->createMock(IGroupManager::class),
+ $this->createMock(IL10N::class),
+ $this->createMock(IFactory::class),
+ $this->createMock(IProviderFactory::class),
+ $this->createMock(IUserManager::class),
+ $this->createMock(IRootFolder::class),
+ $this->createMock(EventDispatcherInterface::class),
+ $this->createMock(IMailer::class),
+ $this->createMock(IURLGenerator::class),
+ $this->createMock(\OC_Defaults::class),
+ $this->createMock(IEventDispatcher::class),
+ $this->createMock(IUserSession::class)
+ );
+ $cap = new Capabilities($config, $shareManager);
$result = $this->getFilesSharingPart($cap->getCapabilities());
return $result;
}