summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CardDAV
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2019-02-16 16:18:58 +0100
committerGeorg Ehrke <developer@georgehrke.com>2019-02-16 16:19:22 +0100
commit3acde071f306a2b0092eb5c81116c8ded971eaeb (patch)
tree80f384623a7bfa624adc06956b6000bfed58438f /apps/dav/tests/unit/CardDAV
parent58520209be38b45438163fe32ef8089ce1bfaa6d (diff)
downloadnextcloud-server-3acde071f306a2b0092eb5c81116c8ded971eaeb.tar.gz
nextcloud-server-3acde071f306a2b0092eb5c81116c8ded971eaeb.zip
Add Repair step to regenerate birthday calendar
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/tests/unit/CardDAV')
-rw-r--r--apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
index 9587640386f..46aa06e8537 100644
--- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
+++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
@@ -329,6 +329,32 @@ class BirthdayServiceTest extends TestCase {
$this->service->ensureCalendarExists('principal001');
}
+ public function testResetForUser() {
+ $this->calDav->expects($this->at(0))
+ ->method('getCalendarByUri')
+ ->with('principals/users/user123', 'contact_birthdays')
+ ->willReturn(['id' => 42]);
+
+ $this->calDav->expects($this->at(1))
+ ->method('getCalendarObjects')
+ ->with(42, 0)
+ ->willReturn([['uri' => '1.ics'], ['uri' => '2.ics'], ['uri' => '3.ics']]);
+
+ $this->calDav->expects($this->at(2))
+ ->method('deleteCalendarObject')
+ ->with(42, '1.ics', 0);
+
+ $this->calDav->expects($this->at(3))
+ ->method('deleteCalendarObject')
+ ->with(42, '2.ics', 0);
+
+ $this->calDav->expects($this->at(4))
+ ->method('deleteCalendarObject')
+ ->with(42, '3.ics', 0);
+
+ $this->service->resetForUser('user123');
+ }
+
public function providesBirthday() {
return [
[true,