diff options
author | Robin Appelman <robin@icewind.nl> | 2021-04-23 17:29:34 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-05-12 16:11:28 +0200 |
commit | b1dca57a1ce59bacc4089761275e4366e9760313 (patch) | |
tree | ed79b9ab833ee9af257dc4f0e68afbd28656043c /apps/files/tests | |
parent | 7e1c842d96cde01ebb6854b3e28fb998006575b2 (diff) | |
download | nextcloud-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/tests')
-rw-r--r-- | apps/files/tests/Controller/ViewControllerTest.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index bc233599e34..3453914b27a 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -48,6 +48,7 @@ use OCP\IRequest; use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserSession; +use OCP\Share\IManager; use OCP\Template; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Test\TestCase; @@ -84,6 +85,8 @@ class ViewControllerTest extends TestCase { private $initialState; /** @var ITemplateManager|\PHPUnit\Framework\MockObject\MockObject */ private $templateManager; + /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ + private $shareManager; protected function setUp(): void { parent::setUp(); @@ -105,6 +108,7 @@ class ViewControllerTest extends TestCase { $this->activityHelper = $this->createMock(Helper::class); $this->initialState = $this->createMock(IInitialState::class); $this->templateManager = $this->createMock(ITemplateManager::class); + $this->shareManager = $this->createMock(IManager::class); $this->viewController = $this->getMockBuilder('\OCA\Files\Controller\ViewController') ->setConstructorArgs([ 'files', @@ -119,6 +123,7 @@ class ViewControllerTest extends TestCase { $this->activityHelper, $this->initialState, $this->templateManager, + $this->shareManager, ]) ->setMethods([ 'getStorageInfo', @@ -153,6 +158,8 @@ class ViewControllerTest extends TestCase { ->expects($this->any()) ->method('getAppValue') ->willReturnArgument(2); + $this->shareManager->method('shareApiAllowLinks') + ->willReturn(true); $nav = new Template('files', 'appnavigation'); $nav->assign('usage_relative', 123); |