From fa036b2001e0505006b6f9fe24d3fc56af937b06 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 5 Nov 2021 10:44:51 +0100 Subject: Move common logic to share manager Signed-off-by: Joas Schilling --- tests/lib/Share20/ManagerTest.php | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'tests/lib/Share20') diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index de8dc9fcc86..5c4d71b34c7 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -22,6 +22,7 @@ namespace Test\Share20; use OC\Files\Mount\MoveableMount; +use OC\KnownUser\KnownUserService; use OC\Share20\DefaultShareProvider; use OC\Share20\Exception; use OC\Share20\Manager; @@ -105,7 +106,10 @@ class ManagerTest extends \Test\TestCase { protected $urlGenerator; /** @var \OC_Defaults|MockObject */ protected $defaults; + /** @var IUserSession|MockObject */ protected $userSession; + /** @var KnownUserService|MockObject */ + protected $knownUserService; protected function setUp(): void { $this->logger = $this->createMock(ILogger::class); @@ -122,6 +126,7 @@ class ManagerTest extends \Test\TestCase { $this->defaults = $this->createMock(\OC_Defaults::class); $this->dispatcher = $this->createMock(IEventDispatcher::class); $this->userSession = $this->createMock(IUserSession::class); + $this->knownUserService = $this->createMock(KnownUserService::class); $this->l10nFactory = $this->createMock(IFactory::class); $this->l = $this->createMock(IL10N::class); @@ -153,7 +158,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $this->defaultProvider = $this->createMock(DefaultShareProvider::class); @@ -183,7 +189,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ]); } @@ -2696,7 +2703,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $share = $this->createMock(IShare::class); @@ -2741,7 +2749,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $share = $this->createMock(IShare::class); @@ -2793,7 +2802,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $share = $this->createMock(IShare::class); @@ -4132,7 +4142,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $this->assertSame($expected, $manager->shareProviderExists($shareType) @@ -4166,7 +4177,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $factory->setProvider($this->defaultProvider); @@ -4231,7 +4243,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $factory->setProvider($this->defaultProvider); @@ -4348,7 +4361,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $factory->setProvider($this->defaultProvider); @@ -4474,7 +4488,8 @@ class ManagerTest extends \Test\TestCase { $this->urlGenerator, $this->defaults, $this->dispatcher, - $this->userSession + $this->userSession, + $this->knownUserService ); $factory->setProvider($this->defaultProvider); -- cgit v1.2.3