diff options
author | Joas Schilling <coding@schilljs.com> | 2017-03-20 12:27:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 12:27:38 +0100 |
commit | 35f6b8716e0f4f851e6c5df19b24a1fa76cca5c0 (patch) | |
tree | 5cffd99f112f9b3a949e1a4aafd611f1060d2530 /apps/files_sharing/tests/MountProviderTest.php | |
parent | 25f772d592172c40ecbb97db71e9590678eab2a4 (diff) | |
parent | 80d2717e5cb80615c2e75885398c26289fad463c (diff) | |
download | nextcloud-server-35f6b8716e0f4f851e6c5df19b24a1fa76cca5c0.tar.gz nextcloud-server-35f6b8716e0f4f851e6c5df19b24a1fa76cca5c0.zip |
Merge pull request #3884 from nextcloud/downstream-26956
Skip null groups in group manager
Diffstat (limited to 'apps/files_sharing/tests/MountProviderTest.php')
-rw-r--r-- | apps/files_sharing/tests/MountProviderTest.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php index 1c83d91d08f..b700d417ad4 100644 --- a/apps/files_sharing/tests/MountProviderTest.php +++ b/apps/files_sharing/tests/MountProviderTest.php @@ -269,6 +269,20 @@ class MountProviderTest extends \Test\TestCase { ['1', 100, 'user2', '/share2-renamed', 31], ], ], + // #9: share as outsider with "nullgroup" and "user1" where recipient renamed in between + [ + [ + [2, 100, 'user2', '/share2', 31], + ], + [ + [1, 100, 'nullgroup', '/share2-renamed', 31], + ], + [ + // use target of least recent share + ['1', 100, 'nullgroup', '/share2-renamed', 31], + ], + true + ], ]; } @@ -284,7 +298,7 @@ class MountProviderTest extends \Test\TestCase { * @param array $groupShares array of group share specs * @param array $expectedShares array of expected supershare specs */ - public function testMergeShares($userShares, $groupShares, $expectedShares) { + public function testMergeShares($userShares, $groupShares, $expectedShares, $moveFails = false) { $rootFolder = $this->createMock(IRootFolder::class); $userManager = $this->createMock(IUserManager::class); @@ -319,6 +333,12 @@ class MountProviderTest extends \Test\TestCase { return new \OC\Share20\Share($rootFolder, $userManager); })); + if ($moveFails) { + $this->shareManager->expects($this->any()) + ->method('moveShare') + ->will($this->throwException(new \InvalidArgumentException())); + } + $mounts = $this->provider->getMountsForUser($this->user, $this->loader); $this->assertCount(count($expectedShares), $mounts); |