From df9a275c89909ff9947e63f9d3a152b7c1d3d37d Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 16 May 2025 17:47:34 +0200 Subject: test: addd test for hideFromCollaboration Signed-off-by: Daniel Kesselberg --- tests/lib/Group/HideFromCollaborationTest.php | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tests/lib/Group/HideFromCollaborationTest.php 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); + } +} -- cgit v1.2.3