diff options
author | Georg Ehrke <developer@georgehrke.com> | 2019-09-02 15:18:43 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2019-09-02 15:18:43 +0200 |
commit | 88f6d1c20edf41bf581d973263a3749948ef4f4c (patch) | |
tree | bd554008994fba80047be2486ff377e1ada29240 /apps/dav/tests/unit/CalDAV | |
parent | daf89e6b34515222b55bdd6bc32c9001664ac548 (diff) | |
download | nextcloud-server-88f6d1c20edf41bf581d973263a3749948ef4f4c.tar.gz nextcloud-server-88f6d1c20edf41bf581d973263a3749948ef4f4c.zip |
Make push notifications for calendar reminders opt-in
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/tests/unit/CalDAV')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php index bbf71837b08..8bd4a660dc4 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php @@ -63,6 +63,7 @@ class PushProviderTest extends AbstractNotificationProviderTest { public function setUp() { parent::setUp(); + $this->config = $this->createMock(IConfig::class); $this->manager = $this->createMock(IManager::class); $this->timeFactory = $this->createMock(ITimeFactory::class); @@ -80,7 +81,38 @@ class PushProviderTest extends AbstractNotificationProviderTest { $this->assertEquals(PushProvider::NOTIFICATION_TYPE, 'DISPLAY'); } + public function testNotSend(): void { + $this->config->expects($this->once()) + ->method('getAppValue') + ->with('dav', 'sendEventRemindersPush', 'no') + ->willReturn('no'); + + $this->manager->expects($this->never()) + ->method('createNotification'); + $this->manager->expects($this->never()) + ->method('notify'); + + $user1 = $this->createMock(IUser::class); + $user1->method('getUID') + ->willReturn('uid1'); + $user2 = $this->createMock(IUser::class); + $user2->method('getUID') + ->willReturn('uid2'); + $user3 = $this->createMock(IUser::class); + $user3->method('getUID') + ->willReturn('uid3'); + + $users = [$user1, $user2, $user3]; + + $this->provider->send($this->vcalendar->VEVENT, $this->calendarDisplayName, $users); + } + public function testSend(): void { + $this->config->expects($this->once()) + ->method('getAppValue') + ->with('dav', 'sendEventRemindersPush', 'no') + ->willReturn('yes'); + $user1 = $this->createMock(IUser::class); $user1->method('getUID') ->willReturn('uid1'); |