@@ -1881,4 +1881,43 @@ public function testUnshare(): void {
18811881 );
18821882
18831883 }
1884+
1885+ public function testDefaultAlarmProperty (): void {
1886+ $ calendarId = $ this ->createTestCalendar ();
1887+
1888+ // Test setting default alarm property to 15 minutes before (-900 seconds)
1889+ $ patch = new PropPatch ([
1890+ '{http://nextcloud.com/ns}default-alarm ' => '-900 '
1891+ ]);
1892+ $ this ->backend ->updateCalendar ($ calendarId , $ patch );
1893+ $ patch ->commit ();
1894+
1895+ // Verify the property was set
1896+ $ calendars = $ this ->backend ->getCalendarsForUser (self ::UNIT_TEST_USER );
1897+ $ this ->assertCount (1 , $ calendars );
1898+ $ this ->assertEquals ('-900 ' , $ calendars [0 ]['{http://nextcloud.com/ns}default-alarm ' ]);
1899+
1900+ // Test updating to a different value (1 day before = -86400 seconds)
1901+ $ patch = new PropPatch ([
1902+ '{http://nextcloud.com/ns}default-alarm ' => '-86400 '
1903+ ]);
1904+ $ this ->backend ->updateCalendar ($ calendarId , $ patch );
1905+ $ patch ->commit ();
1906+
1907+ $ calendars = $ this ->backend ->getCalendarsForUser (self ::UNIT_TEST_USER );
1908+ $ this ->assertEquals ('-86400 ' , $ calendars [0 ]['{http://nextcloud.com/ns}default-alarm ' ]);
1909+
1910+ // Test setting to "none"
1911+ $ patch = new PropPatch ([
1912+ '{http://nextcloud.com/ns}default-alarm ' => 'none '
1913+ ]);
1914+ $ this ->backend ->updateCalendar ($ calendarId , $ patch );
1915+ $ patch ->commit ();
1916+
1917+ $ calendars = $ this ->backend ->getCalendarsForUser (self ::UNIT_TEST_USER );
1918+ $ this ->assertEquals ('none ' , $ calendars [0 ]['{http://nextcloud.com/ns}default-alarm ' ]);
1919+
1920+ // Clean up
1921+ $ this ->backend ->deleteCalendar ($ calendars [0 ]['id ' ], true );
1922+ }
18841923}
0 commit comments