diff options
author | Robin Appelman <robin@icewind.nl> | 2023-09-04 14:05:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 14:05:14 +0200 |
commit | 64f62f7cfd9c84090dcb78106ad692c5cb75ee20 (patch) | |
tree | ce1864c2425c4dcae22b9438352e1cff6ba44310 /tests/lib/Share20 | |
parent | 489a57e9a382ac72ee46d8740506f4e8f607d131 (diff) | |
parent | e73889a24099091810a66623ded57346692ae2d6 (diff) | |
download | nextcloud-server-64f62f7cfd9c84090dcb78106ad692c5cb75ee20.tar.gz nextcloud-server-64f62f7cfd9c84090dcb78106ad692c5cb75ee20.zip |
Merge pull request #39863 from nextcloud/sharing-mask-wrapper
move share permission logic to storage wrapper
Diffstat (limited to 'tests/lib/Share20')
-rw-r--r-- | tests/lib/Share20/ManagerTest.php | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index 1f3bcd405a1..c770181799f 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -27,6 +27,7 @@ use OC\Share20\DefaultShareProvider; use OC\Share20\Exception; use OC\Share20\Manager; use OC\Share20\Share; +use OC\Share20\ShareDisableChecker; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\File; @@ -111,6 +112,8 @@ class ManagerTest extends \Test\TestCase { protected $userSession; /** @var KnownUserService|MockObject */ protected $knownUserService; + /** @var ShareDisableChecker|MockObject */ + protected $shareDisabledChecker; protected function setUp(): void { $this->logger = $this->createMock(LoggerInterface::class); @@ -128,6 +131,8 @@ class ManagerTest extends \Test\TestCase { $this->userSession = $this->createMock(IUserSession::class); $this->knownUserService = $this->createMock(KnownUserService::class); + $this->shareDisabledChecker = new ShareDisableChecker($this->config, $this->userManager, $this->groupManager); + $this->l10nFactory = $this->createMock(IFactory::class); $this->l = $this->createMock(IL10N::class); $this->l->method('t') @@ -158,7 +163,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker ); $this->defaultProvider = $this->createMock(DefaultShareProvider::class); @@ -188,7 +194,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker, ]); } @@ -2755,7 +2762,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker, ); $share = $this->createMock(IShare::class); @@ -2802,7 +2810,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker, ); $share = $this->createMock(IShare::class); @@ -2856,7 +2865,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker, ); $share = $this->createMock(IShare::class); @@ -4255,7 +4265,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker, ); $this->assertSame($expected, $manager->shareProviderExists($shareType) @@ -4289,7 +4300,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker, ); $factory->setProvider($this->defaultProvider); @@ -4354,7 +4366,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker, ); $factory->setProvider($this->defaultProvider); @@ -4471,7 +4484,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker, ); $factory->setProvider($this->defaultProvider); @@ -4597,7 +4611,8 @@ class ManagerTest extends \Test\TestCase { $this->defaults, $this->dispatcher, $this->userSession, - $this->knownUserService + $this->knownUserService, + $this->shareDisabledChecker ); $factory->setProvider($this->defaultProvider); |