Page MenuHomePhorge

D4887.id14025.diff
No OneTemporary

D4887.id14025.diff

diff --git a/src/tests/Infrastructure/DavTest.php b/src/tests/Infrastructure/DavTest.php
--- a/src/tests/Infrastructure/DavTest.php
+++ b/src/tests/Infrastructure/DavTest.php
@@ -2,6 +2,7 @@
namespace Tests\Infrastructure;
+use App\Backends\DAV;
use Tests\TestCase;
/**
@@ -201,6 +202,64 @@
$this->assertStringContainsString("<d:href>$href</d:href>", $data);
}
+ /**
+ * Test calendar event creation
+ */
+ public function testCalendarEventsCreation(): void
+ {
+ $email = $this->user->email;
+ $vevent = <<<EOF
+ BEGIN:VCALENDAR
+ METHOD:PUBLISH
+ PRODID:Microsoft Exchange Server 2010
+ VERSION:2.0
+ BEGIN:VTIMEZONE
+ TZID:Central European Standard Time
+ BEGIN:STANDARD
+ DTSTART:16010101T030000
+ TZOFFSETFROM:+0200
+ TZOFFSETTO:+0100
+ RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
+ END:STANDARD
+ BEGIN:DAYLIGHT
+ DTSTART:16010101T020000
+ TZOFFSETFROM:+0100
+ TZOFFSETTO:+0200
+ RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
+ END:DAYLIGHT
+ END:VTIMEZONE
+ BEGIN:VEVENT
+ ORGANIZER;CN=Aleksander Machniak:mailto:{$email}
+ ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Aleksander
+ Machniak:mailto:test@kolab.org
+ ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Alec Machn
+ iak:mailto:alec@outlook.com
+ DESCRIPTION:*test to ms*
+ UID:1F3C13D7E99642A75ABE23D50487B454-8FE68B2E68E1B348
+ SUMMARY:test to ms
+ DTSTART;TZID=Central European Standard Time:20231121T120000
+ DTEND;TZID=Central European Standard Time:20231121T123000
+ CLASS:PUBLIC
+ PRIORITY:5
+ DTSTAMP:20231120T145005Z
+ TRANSP:OPAQUE
+ STATUS:CONFIRMED
+ SEQUENCE:0
+ END:VEVENT
+ END:VCALENDAR
+ EOF;
+
+ $event = new DAV\Opaque(str_replace("\n", "\r\n", $vevent));
+ $event->contentType = 'text/calendar; charset=utf-8';
+ $event->href = "calendars/user/{$email}/Default/1F3C13D7E99642A75ABE23D50487B454-8FE68B2E68E1B348.ics";
+
+ $dav = new DAV($this->user->email, 'simple123');
+
+ // The error that does not make sense (on Cyrus DAV) is 403 with this in the XML body:
+ // Failed iTIP restrictions for ATTENDEE property. Expected 0 instances of the property and got 2.
+ $this->assertTrue($dav->create($event) !== false);
+ }
+
/**
* Thunderbird does this and relies on the WWW-Authenticate header response to
* start sending authenticated requests.

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 8:55 PM (18 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10202506
Default Alt Text
D4887.id14025.diff (2 KB)

Event Timeline