Skip to content

Commit 0dd5037

Browse files
committed
fix: Adapt tests
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 8aca7b5 commit 0dd5037

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

tests/lib/Group/GroupTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ protected function getUserManager() {
5252
$user3 = $this->newUser('user3', $backend);
5353
$userManager->expects($this->any())
5454
->method('get')
55-
->willReturnMap([
56-
['user1', $user1],
57-
['user2', $user2],
58-
['user3', $user3]
59-
]);
55+
->willReturnCallback(fn (string $userId, array $excludedBackend) => match ($userId) {
56+
'user1' => $user1,
57+
'user2' => $user2,
58+
'user3' => $user3,
59+
});
6060
return $userManager;
6161
}
6262

tests/lib/Repair/CleanTagsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ public function testRun() {
103103
$this->userManager->expects($this->exactly(2))
104104
->method('userExists')
105105
->willReturnMap([
106-
['userExists', true],
107-
['TestRepairCleanTags', false],
106+
['userExists', [], true],
107+
['TestRepairCleanTags', [], false],
108108
]);
109109

110110
self::invokePrivate($this->repair, 'deleteOrphanTags', [$this->outputMock]);

tests/lib/Share20/ManagerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,8 @@ public function testGeneralChecks($share, $exceptionMessage, $exception) {
986986
$thrown = null;
987987

988988
$this->userManager->method('userExists')->willReturnMap([
989-
['user0', true],
990-
['user1', true],
989+
['user0', [], true],
990+
['user1', [], true],
991991
]);
992992

993993
$this->groupManager->method('groupExists')->willReturnMap([
@@ -1030,8 +1030,8 @@ public function testGeneralCheckShareRoot() {
10301030
$thrown = null;
10311031

10321032
$this->userManager->method('userExists')->willReturnMap([
1033-
['user0', true],
1034-
['user1', true],
1033+
['user0', [], true],
1034+
['user1', [], true],
10351035
]);
10361036

10371037
$userFolder = $this->createMock(Folder::class);

0 commit comments

Comments
 (0)