summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit')
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php32
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');