diff options
author | Louis Chemineau <louis@chmn.me> | 2023-01-18 16:53:22 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2023-02-02 15:41:26 +0100 |
commit | 4ab3c16403e69811cf2353ba2bfeafcbcf259c42 (patch) | |
tree | 981b24806dfde120a7170957cac022b3bfdb74b9 /apps/files_sharing/tests | |
parent | fc4e87a2dfc5ff53bc9f15da13f355dd285769a9 (diff) | |
download | nextcloud-server-4ab3c16403e69811cf2353ba2bfeafcbcf259c42.tar.gz nextcloud-server-4ab3c16403e69811cf2353ba2bfeafcbcf259c42.zip |
Pluggable share provider
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/Controller/ShareControllerTest.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index 781372b889e..7445fa1d7ab 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -69,6 +69,8 @@ use OCP\Activity\IManager; use OCP\Files\IRootFolder; use OCP\Defaults; use OC\Share20\Manager; +use OCA\Files_Sharing\DefaultPublicShareTemplateProvider; +use OCP\Share\IPublicShareTemplateFactory; /** * @group DB @@ -110,6 +112,8 @@ class ShareControllerTest extends \Test\TestCase { private $secureRandom; /** @var Defaults|MockObject */ private $defaults; + /** @var IPublicShareTemplateFactory|MockObject */ + private $publicShareTemplateFactory; protected function setUp(): void { parent::setUp(); @@ -131,6 +135,24 @@ class ShareControllerTest extends \Test\TestCase { $this->l10n = $this->createMock(IL10N::class); $this->secureRandom = $this->createMock(ISecureRandom::class); $this->defaults = $this->createMock(Defaults::class); + $this->publicShareTemplateFactory = $this->createMock(IPublicShareTemplateFactory::class); + $this->publicShareTemplateFactory + ->expects($this->any()) + ->method('getProvider') + ->willReturn( + new DefaultPublicShareTemplateProvider( + $this->userManager, + $this->accountManager, + $this->previewManager, + $this->federatedShareProvider, + $this->urlGenerator, + $this->eventDispatcher, + $this->l10n, + $this->defaults, + $this->config, + $this->createMock(IRequest::class), + ) + ); $this->shareController = new \OCA\Files_Sharing\Controller\ShareController( $this->appName, @@ -149,7 +171,8 @@ class ShareControllerTest extends \Test\TestCase { $this->eventDispatcher, $this->l10n, $this->secureRandom, - $this->defaults + $this->defaults, + $this->publicShareTemplateFactory, ); |