fix: Fix tests

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-02-16 18:51:43 +01:00
parent b19b7794bc
commit 46df19a3a6
5 changed files with 10 additions and 8 deletions

View File

@@ -160,7 +160,7 @@ class BoardService {
}
$complete = $this->getUserBoards($since, $includeArchived);
return $this->enrichBoards($complete, $fullDetails !== null);
return $this->enrichBoards($complete, $fullDetails);
}
/**
@@ -675,7 +675,6 @@ class BoardService {
} else {
$this->boardsCachePartial[$board->getId()] = $board;
}
}
return $boards;
@@ -703,7 +702,7 @@ class BoardService {
private function enrichWithUsers($board, $since = -1) {
$boardUsers = $this->permissionService->findUsers($board->getId());
if (\count($boardUsers) === 0) {
if ($boardUsers === null || \count($boardUsers) === 0) {
return;
}
$board->setUsers(array_values($boardUsers));

View File

@@ -175,7 +175,7 @@ class CardService {
public function find(int $cardId) {
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_READ);
$card = $this->cardMapper->find($cardId);
$this->enrichCards([$card]);
[$card] = $this->enrichCards([$card]);
// Attachments are only enriched on individual card fetching
$attachments = $this->attachmentService->findAll($cardId, true);