From 6eb1bc55ab24cf1cfae5995d5fbb976120df32d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Thu, 28 Jul 2016 14:19:39 +0200 Subject: [PATCH] The birthday calendar can only hold VEVENT - refs https://github.com/owncloud/tasks/issues/338 --- apps/dav/lib/CalDAV/BirthdayService.php | 1 + apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 31a6c73f48485..cadaca0bdb9de 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -116,6 +116,7 @@ public function ensureCalendarExists($principal) { $this->calDavBackEnd->createCalendar($principal, self::BIRTHDAY_CALENDAR_URI, [ '{DAV:}displayname' => 'Contact birthdays', '{http://apple.com/ns/ical/}calendar-color' => '#FFFFCA', + 'components' => 'VEVENT', ]); return $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI); diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php index 33968ec242d56..7c772184fefe6 100644 --- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php @@ -182,6 +182,17 @@ public function testGetAllAffectedPrincipals() { ], $users); } + public function testBirthdayCalendarHasComponentEvent() { + $this->calDav->expects($this->once()) + ->method('createCalendar') + ->with('principal001', 'contact_birthdays', [ + '{DAV:}displayname' => 'Contact birthdays', + '{http://apple.com/ns/ical/}calendar-color' => '#FFFFCA', + 'components' => 'VEVENT', + ]); + $this->service->ensureCalendarExists('principal001'); + } + public function providesBirthday() { return [ [true,