From 493907fe7659eadb3a45a36190d0e5ae9ba184ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 16 Apr 2021 17:18:15 +0200 Subject: [PATCH] Fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/BoardService.php | 5 +---- tests/unit/Notification/NotificationHelperTest.php | 11 +++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Service/BoardService.php b/lib/Service/BoardService.php index 2db850e0e..0f79f0a5a 100644 --- a/lib/Service/BoardService.php +++ b/lib/Service/BoardService.php @@ -532,13 +532,10 @@ class BoardService { $acl->setPermissionShare($share); $acl->setPermissionManage($manage); - /* Notify users about the shared board */ - $this->notificationHelper->sendBoardShared($boardId, $acl); - $newAcl = $this->aclMapper->insert($acl); $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->changeHelper->boardChanged($boardId); diff --git a/tests/unit/Notification/NotificationHelperTest.php b/tests/unit/Notification/NotificationHelperTest.php index 80d7997e6..83ad2e9e4 100644 --- a/tests/unit/Notification/NotificationHelperTest.php +++ b/tests/unit/Notification/NotificationHelperTest.php @@ -130,7 +130,8 @@ class NotificationHelperTest extends \Test\TestCase { $card = Card::fromParams([ 'notified' => false, 'id' => 123, - 'title' => 'MyCardTitle' + 'title' => 'MyCardTitle', + 'duedate' => '2020-12-24' ]); $this->cardMapper->expects($this->once()) ->method('findBoardId') @@ -225,7 +226,8 @@ class NotificationHelperTest extends \Test\TestCase { $card = Card::fromParams([ 'notified' => false, 'id' => 123, - 'title' => 'MyCardTitle' + 'title' => 'MyCardTitle', + 'duedate' => '2020-12-24' ]); $card->setAssignedUsers([ new User($users[0]) @@ -323,7 +325,8 @@ class NotificationHelperTest extends \Test\TestCase { $card = Card::fromParams([ 'notified' => false, 'id' => 123, - 'title' => 'MyCardTitle' + 'title' => 'MyCardTitle', + 'duedate' => '2020-12-24' ]); $card->setAssignedUsers([ new User($users[0]) @@ -470,7 +473,7 @@ class NotificationHelperTest extends \Test\TestCase { ->with(123) ->willReturn($board); $user = $this->createMock(IUser::class); - $user->expects($this->once()) + $user->expects($this->any()) ->method('getUID') ->willReturn('userA'); $group = $this->createMock(IGroup::class);