diff options
Diffstat (limited to 'apps/files_sharing/tests/External/ManagerTest.php')
-rw-r--r-- | apps/files_sharing/tests/External/ManagerTest.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index 2340d057dd7..1a6d83ce719 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -143,9 +143,17 @@ class ManagerTest extends TestCase { $group1->expects($this->any())->method('getGID')->willReturn('group1'); $group1->expects($this->any())->method('inGroup')->with($this->user)->willReturn(true); + $group2 = $this->createMock(IGroup::class); + $group2->expects($this->any())->method('getGID')->willReturn('group2'); + $group2->expects($this->any())->method('inGroup')->with($this->user)->willReturn(true); + $this->userManager->expects($this->any())->method('get')->willReturn($this->user); - $this->groupManager->expects($this->any())->method(('getUserGroups'))->willReturn([$group1]); - $this->groupManager->expects($this->any())->method(('get'))->with('group1')->willReturn($group1); + $this->groupManager->expects($this->any())->method(('getUserGroups'))->willReturn([$group1, $group2]); + $this->groupManager->expects($this->any())->method(('get')) + ->will($this->returnValueMap([ + ['group1', $group1], + ['group2', $group2], + ])); } protected function tearDown(): void { |