diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php index 1f9497aa85d..788a8963977 100644 --- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php @@ -447,12 +447,11 @@ class UserPluginTest extends TestCase { [$this->user->getUID(), 'test1', true], [$this->user->getUID(), 'test2', true], ]); - } else { - $this->userManager->expects($this->once()) - ->method('searchDisplayName') - ->with($searchTerm, $this->limit, $this->offset) - ->willReturn($userResponse); } + $this->userManager->expects($this->once()) + ->method('searchDisplayName') + ->with($searchTerm, $this->limit, $this->offset) + ->willReturn($userResponse); } else { $this->groupManager->method('getUserGroupIds') ->with($this->user) @@ -690,7 +689,7 @@ class UserPluginTest extends TestCase { } #[DataProvider('dataSearchEnumeration')] - public function testSearchEnumerationLimit($search, $userGroups, $matchingUsers, $result, $mockedSettings): void { + public function testSearchEnumerationLimit(string $search, $userGroups, $matchingUsers, $result, $mockedSettings): void { $this->mockConfig($mockedSettings); $userResults = []; @@ -737,10 +736,10 @@ class UserPluginTest extends TestCase { ->willReturnCallback(function ($search) use ($matchingUsers) { $users = array_filter( $matchingUsers, - fn ($user) => str_contains(strtolower($user['displayName']), strtolower($search)) + fn ($user) => str_contains(strtolower($user['displayName'] ?? ''), strtolower($search)) ); return array_map( - fn ($user) => $this->getUserMock($user['uid'], $user['displayName']), + fn ($user) => $this->getUserMock($user['uid'], $user['displayName'] ?? ''), $users); });