Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2021-05-21 16:35:39 +0300
committerGitHub <noreply@github.com>2021-05-21 16:35:39 +0300
commitf1dbabd9109c08e62d6f82124c63201c96ad2203 (patch)
treeea6b862c1fa97ec5ad03895c120268bd25d1d35e /apps/files_sharing/tests
parentb1ad3faf14140e3c85a7eec1dade88cd551cc747 (diff)
parent8d7fae8fae054eaa08635fea3ba092196c6f8b84 (diff)
Merge pull request #26727 from nextcloud/group-exclude-link-share
Add option to exclude groups from creating link shares
Diffstat (limited to 'apps/files_sharing/tests')
-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;
}