Skip to content

Commit 986d6a2

Browse files
committed
test: adjust test cases
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent a743a5a commit 986d6a2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/lib/Collaboration/Collaborators/UserPluginTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ public function testSearch(
456456
->method('getUser')
457457
->willReturn($this->user);
458458

459+
$this->userManager->expects($this->any())
460+
->method('searchDisplayName')
461+
->willReturn($userResponse);
462+
459463
if (!$shareWithGroupOnly) {
460464
if ($shareeEnumerationPhone) {
461465
$this->userManager->expects($this->once())
@@ -766,10 +770,10 @@ public function testSearchEnumerationLimit($search, $userGroups, $matchingUsers,
766770
->willReturnCallback(function ($search) use ($matchingUsers) {
767771
$users = array_filter(
768772
$matchingUsers,
769-
fn ($user) => str_contains(strtolower($user['displayName']), strtolower($search))
773+
fn ($user) => str_contains(strtolower($user['displayName'] ?? $user['uid']), strtolower($search))
770774
);
771775
return array_map(
772-
fn ($user) => $this->getUserMock($user['uid'], $user['displayName']),
776+
fn ($user) => $this->getUserMock($user['uid'], $user['displayName'] ?? $user['uid']),
773777
$users);
774778
});
775779

0 commit comments

Comments
 (0)