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("$href", $data); } + /** + * Test calendar event creation + */ + public function testCalendarEventsCreation(): void + { + $email = $this->user->email; + $vevent = <<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.