mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(tests): Fix UserPluginTest methods expectation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
8107f614d8
commit
5e9af71509
1 changed files with 7 additions and 8 deletions
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue