From 5e9af71509025ac95d38178e2b9e1b6dd744a112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Sat, 27 Sep 2025 13:30:57 +0200 Subject: [PATCH] fix(tests): Fix UserPluginTest methods expectation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- .../Collaborators/UserPluginTest.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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); });