Fix tests

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2021-04-16 17:18:15 +02:00
parent 5ae22ec6de
commit 493907fe76
2 changed files with 8 additions and 8 deletions

View File

@@ -532,13 +532,10 @@ class BoardService {
$acl->setPermissionShare($share); $acl->setPermissionShare($share);
$acl->setPermissionManage($manage); $acl->setPermissionManage($manage);
/* Notify users about the shared board */
$this->notificationHelper->sendBoardShared($boardId, $acl);
$newAcl = $this->aclMapper->insert($acl); $newAcl = $this->aclMapper->insert($acl);
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_BOARD, $newAcl, ActivityManager::SUBJECT_BOARD_SHARE); $this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_BOARD, $newAcl, ActivityManager::SUBJECT_BOARD_SHARE);
$this->notificationHelper->sendBoardShared((int)$boardId, $acl); $this->notificationHelper->sendBoardShared((int)$boardId, $newAcl);
$this->boardMapper->mapAcl($newAcl); $this->boardMapper->mapAcl($newAcl);
$this->changeHelper->boardChanged($boardId); $this->changeHelper->boardChanged($boardId);

View File

@@ -130,7 +130,8 @@ class NotificationHelperTest extends \Test\TestCase {
$card = Card::fromParams([ $card = Card::fromParams([
'notified' => false, 'notified' => false,
'id' => 123, 'id' => 123,
'title' => 'MyCardTitle' 'title' => 'MyCardTitle',
'duedate' => '2020-12-24'
]); ]);
$this->cardMapper->expects($this->once()) $this->cardMapper->expects($this->once())
->method('findBoardId') ->method('findBoardId')
@@ -225,7 +226,8 @@ class NotificationHelperTest extends \Test\TestCase {
$card = Card::fromParams([ $card = Card::fromParams([
'notified' => false, 'notified' => false,
'id' => 123, 'id' => 123,
'title' => 'MyCardTitle' 'title' => 'MyCardTitle',
'duedate' => '2020-12-24'
]); ]);
$card->setAssignedUsers([ $card->setAssignedUsers([
new User($users[0]) new User($users[0])
@@ -323,7 +325,8 @@ class NotificationHelperTest extends \Test\TestCase {
$card = Card::fromParams([ $card = Card::fromParams([
'notified' => false, 'notified' => false,
'id' => 123, 'id' => 123,
'title' => 'MyCardTitle' 'title' => 'MyCardTitle',
'duedate' => '2020-12-24'
]); ]);
$card->setAssignedUsers([ $card->setAssignedUsers([
new User($users[0]) new User($users[0])
@@ -470,7 +473,7 @@ class NotificationHelperTest extends \Test\TestCase {
->with(123) ->with(123)
->willReturn($board); ->willReturn($board);
$user = $this->createMock(IUser::class); $user = $this->createMock(IUser::class);
$user->expects($this->once()) $user->expects($this->any())
->method('getUID') ->method('getUID')
->willReturn('userA'); ->willReturn('userA');
$group = $this->createMock(IGroup::class); $group = $this->createMock(IGroup::class);