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:
authorJoas Schilling <coding@schilljs.com>2021-11-05 12:44:51 +0300
committerJoas Schilling <coding@schilljs.com>2021-11-09 12:10:53 +0300
commitfa036b2001e0505006b6f9fe24d3fc56af937b06 (patch)
tree7d102e103cf131ccf3ec8d5650b6a3de13e835e6 /tests/lib/Share20
parentf4307ef4b16ffa1ea5a9e4697b57be36660a7953 (diff)
Move common logic to share manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/Share20')
-rw-r--r--tests/lib/Share20/ManagerTest.php35
1 files changed, 25 insertions, 10 deletions
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);