diff --git a/tests/lib/Group/HideFromCollaborationTest.php b/tests/lib/Group/HideFromCollaborationTest.php new file mode 100644 index 00000000000..5ff7c797508 --- /dev/null +++ b/tests/lib/Group/HideFromCollaborationTest.php @@ -0,0 +1,53 @@ +userManager = $this->createMock(IUserManager::class); + $this->dispatcher = $this->createMock(IEventDispatcher::class); + } + + + public function testHideFromCollaboration(): void { + // Arrange + $backend1 = $this->createMock(HideFromCollaborationBackendTest::class); + $backend1->method('hideGroup') + ->willReturn(false); + $backend2 = $this->createMock(HideFromCollaborationBackendTest::class); + $backend2->method('hideGroup') + ->willReturn(true); + $group = new Group('group1', [$backend1, $backend2], $this->dispatcher, $this->userManager); + + // Act + $result = $group->hideFromCollaboration(); + + // Assert + $this->assertTrue($result); + } +}