mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-03-13 08:00:15 +00:00
Tests for MONTHLY recurrence where DTSTART is on the 29th of Feb
Each of the recurring events should also be on the 29th. Currently these tests fail as the generated events are on the 28th. Oops.
This commit is contained in:
parent
7b2fa34f73
commit
64f47fd9e6
@ -130,6 +130,7 @@ $tests = array(
|
||||
, new RRuleTest( "31st of each month", "20110831", "RRULE:FREQ=MONTHLY;BYMONTHDAY=31;COUNT=12" )
|
||||
, new RRuleTest( "Expand over daylight savings change day forward - but no time change (2020-09-27)", "20200925T011500 Pacific/Auckland", "RRULE:FREQ=DAILY;COUNT=12" )
|
||||
, new RRuleTest( "Expand over daylight savings change forward - time jump (2020-09-27) - According to RFC 5545, because 02:15 doesn't exist on 2020-09-27, that day should be skipped", "20200925T021500 Pacific/Auckland", "RRULE:FREQ=DAILY;COUNT=12" )
|
||||
, new RRuleTest( "Monthly, from the 29th of Feb", "20120229", "RRULE:FREQ=MONTHLY;COUNT=12" )
|
||||
);
|
||||
|
||||
foreach( $tests AS $k => $test ) {
|
||||
|
||||
@ -557,3 +557,19 @@ SQL Result:
|
||||
2020-09-29 03:15:00 2020-09-30 03:15:00 2020-10-01 03:15:00 2020-10-02 03:15:00
|
||||
2020-10-03 03:15:00 2020-10-04 03:15:00 2020-10-05 03:15:00 2020-10-06 03:15:00
|
||||
|
||||
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
|
||||
20120229 - RRULE:FREQ=MONTHLY;COUNT=12
|
||||
Monthly, from the 29th of Feb
|
||||
PHP & SQL results are identical (-:
|
||||
PHP Result:
|
||||
|
||||
2012-02-29 00:00:00 2012-03-29 00:00:00 2012-04-29 00:00:00 2012-05-29 00:00:00
|
||||
2012-06-29 00:00:00 2012-07-29 00:00:00 2012-08-29 00:00:00 2012-09-29 00:00:00
|
||||
2012-10-29 00:00:00 2012-11-29 00:00:00 2012-12-29 00:00:00 2013-01-29 00:00:00
|
||||
|
||||
SQL Result:
|
||||
|
||||
2012-02-29 00:00:00 2012-03-29 00:00:00 2012-04-29 00:00:00 2012-05-29 00:00:00
|
||||
2012-06-29 00:00:00 2012-07-29 00:00:00 2012-08-29 00:00:00 2012-09-29 00:00:00
|
||||
2012-10-29 00:00:00 2012-11-29 00:00:00 2012-12-29 00:00:00 2013-01-29 00:00:00
|
||||
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
HTTP/1.1 201 Created
|
||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
|
||||
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
|
||||
ETag: "fc35b776d6f18fcae1dff27c130cf669"
|
||||
Content-Length: 0
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
|
||||
|
||||
CalDAV Data: >BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:-//davical.org//NONSGML AWL Calendar//EN
|
||||
CALSCALE:GREGORIAN
|
||||
BEGIN:VTIMEZONE
|
||||
TZID:Pacific/Auckland
|
||||
BEGIN:STANDARD
|
||||
TZOFFSETFROM:+1300
|
||||
TZOFFSETTO:+1200
|
||||
DTSTART:19900318T030000
|
||||
RRULE:FREQ=YEARLY;UNTIL=20070317T140000Z;BYMONTH=3;BYDAY=3SU
|
||||
TZNAME:NZST
|
||||
END:STANDARD
|
||||
BEGIN:DAYLIGHT
|
||||
TZOFFSETFROM:+1200
|
||||
TZOFFSETTO:+1300
|
||||
DTSTART:19901007T020000
|
||||
RRULE:FREQ=YEARLY;UNTIL=20060930T140000Z;BYMONTH=10;BYDAY=1SU
|
||||
TZNAME:NZDT
|
||||
END:DAYLIGHT
|
||||
END:VTIMEZONE
|
||||
BEGIN:VEVENT
|
||||
UID:RFC5545-Compliance-MONTHLY-Feb
|
||||
DTSTAMP:20210918T123000
|
||||
SUMMARY:I repeat monthly on the 29th
|
||||
CREATED:20210918T123000
|
||||
DTSTART;TZID=Pacific/Auckland:20240229T070000
|
||||
DTEND;TZID=Pacific/Auckland:20240229T080000
|
||||
RRULE:FREQ=MONTHLY;COUNT=12
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
<
|
||||
caldav_type: >VEVENT<
|
||||
class: >PUBLIC<
|
||||
dav_etag: >fc35b776d6f18fcae1dff27c130cf669<
|
||||
description: >NULL<
|
||||
dtend: >2024-02-29 08:00:00<
|
||||
dtstamp: >2021-09-18 12:30:00<
|
||||
dtstart: >2024-02-29 07:00:00<
|
||||
due: >NULL<
|
||||
last_modified: >2021-09-18 12:30:00<
|
||||
location: >NULL<
|
||||
logged_user: >13<
|
||||
percent_complete: >NULL<
|
||||
priority: >NULL<
|
||||
rrule: >FREQ=MONTHLY;COUNT=12<
|
||||
status: >NULL<
|
||||
summary: >I repeat monthly on the 29th<
|
||||
transp: >NULL<
|
||||
tz_id: >Pacific/Auckland<
|
||||
uid: >RFC5545-Compliance-MONTHLY-Feb<
|
||||
url: >NULL<
|
||||
user_no: >13<
|
||||
~Duration: >01:00:00<
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
#
|
||||
# Create an event that repeats monthly, created on Feb 29th.
|
||||
#
|
||||
# Should only return busy times on months where the 29th is present.
|
||||
#
|
||||
TYPE=PUT
|
||||
URL=http://regression.host/caldav.php/user4/home/RFC5545-Compliance-MONTHLY-Feb.ics
|
||||
HEADER=Content-Type: text/calendar
|
||||
AUTH=user4:user4
|
||||
HEAD
|
||||
|
||||
|
||||
BEGINDATA
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:-//davical.org//NONSGML AWL Calendar//EN
|
||||
CALSCALE:GREGORIAN
|
||||
BEGIN:VTIMEZONE
|
||||
TZID:Pacific/Auckland
|
||||
BEGIN:STANDARD
|
||||
TZOFFSETFROM:+1300
|
||||
TZOFFSETTO:+1200
|
||||
DTSTART:19900318T030000
|
||||
RRULE:FREQ=YEARLY;UNTIL=20070317T140000Z;BYMONTH=3;BYDAY=3SU
|
||||
TZNAME:NZST
|
||||
END:STANDARD
|
||||
BEGIN:DAYLIGHT
|
||||
TZOFFSETFROM:+1200
|
||||
TZOFFSETTO:+1300
|
||||
DTSTART:19901007T020000
|
||||
RRULE:FREQ=YEARLY;UNTIL=20060930T140000Z;BYMONTH=10;BYDAY=1SU
|
||||
TZNAME:NZDT
|
||||
END:DAYLIGHT
|
||||
END:VTIMEZONE
|
||||
BEGIN:VEVENT
|
||||
UID:RFC5545-Compliance-MONTHLY-Feb
|
||||
DTSTAMP:20210918T123000
|
||||
SUMMARY:I repeat monthly on the 29th
|
||||
CREATED:20210918T123000
|
||||
DTSTART;TZID=Pacific/Auckland:20240229T070000
|
||||
DTEND;TZID=Pacific/Auckland:20240229T080000
|
||||
RRULE:FREQ=MONTHLY;COUNT=12
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
ENDDATA
|
||||
|
||||
|
||||
QUERY
|
||||
SELECT caldav_data.user_no, caldav_data.dav_etag, caldav_type, logged_user,
|
||||
uid, dtstamp, dtstart at time zone olson_name as dtstart,
|
||||
dtend at time zone olson_name as dtend, due, summary, location,
|
||||
description, priority, class, transp, rrule, url,
|
||||
percent_complete, tz_id, status,
|
||||
caldav_data AS " CalDAV Data", calendar_item.last_modified,
|
||||
dtend - dtstart AS "~Duration"
|
||||
FROM caldav_data LEFT JOIN calendar_item USING(dav_name) LEFT JOIN timezones ON (tz_id=tzid)
|
||||
WHERE caldav_data.dav_name =
|
||||
'/user4/home/RFC5545-Compliance-MONTHLY-Feb.ics';
|
||||
ENDQUERY
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
HTTP/1.1 200 OK
|
||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
|
||||
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
|
||||
Content-Length: 706
|
||||
Content-Type: text/calendar;charset=UTF-8
|
||||
|
||||
BEGIN:VCALENDAR
|
||||
PRODID:-//davical.org//NONSGML AWL Calendar//EN
|
||||
VERSION:2.0
|
||||
CALSCALE:GREGORIAN
|
||||
BEGIN:VFREEBUSY
|
||||
DTSTAMP:yyyymmddThhmmssZ
|
||||
DTSTART:20240101T000000Z
|
||||
DTEND:20250110T000000Z
|
||||
FREEBUSY:20240228T180000Z/20240228T190000Z
|
||||
FREEBUSY:20240328T180000Z/20240328T190000Z
|
||||
FREEBUSY:20240428T190000Z/20240428T200000Z
|
||||
FREEBUSY:20240528T190000Z/20240528T200000Z
|
||||
FREEBUSY:20240628T190000Z/20240628T200000Z
|
||||
FREEBUSY:20240728T190000Z/20240728T200000Z
|
||||
FREEBUSY:20240828T190000Z/20240828T200000Z
|
||||
FREEBUSY:20240928T180000Z/20240928T190000Z
|
||||
FREEBUSY:20241028T180000Z/20241028T190000Z
|
||||
FREEBUSY:20241128T180000Z/20241128T190000Z
|
||||
FREEBUSY:20241228T180000Z/20241228T190000Z
|
||||
END:VFREEBUSY
|
||||
END:VCALENDAR
|
||||
@ -0,0 +1,17 @@
|
||||
#
|
||||
# Fetch the recurring events for the year.
|
||||
|
||||
TYPE=REPORT
|
||||
URL=http://regression.host/caldav.php/user4/home/
|
||||
HEADER=Content-Type: text/xml; charset="UTF-8"
|
||||
AUTH=user4:user4
|
||||
HEAD
|
||||
|
||||
BEGINDATA
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<C:free-busy-query xmlns:C='urn:ietf:params:xml:ns:caldav'>
|
||||
<C:time-range start='20240101T000000Z' end='20250110T000000Z'/>
|
||||
</C:free-busy-query>
|
||||
ENDDATA
|
||||
|
||||
REPLACE=/^DTSTAMP:\d{8}T\d{6}Z\r?$/DTSTAMP:yyyymmddThhmmssZ/
|
||||
@ -0,0 +1,6 @@
|
||||
HTTP/1.1 204 No Content
|
||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
|
||||
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
|
||||
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
#
|
||||
# Remove the event that repeats monthly on the 31st.
|
||||
#
|
||||
TYPE=DELETE
|
||||
URL=http://regression.host/caldav.php/user4/home/RFC5545-Compliance-MONTHLY-Feb.ics
|
||||
HEADER=Content-Type: text/calendar
|
||||
AUTH=user4:user4
|
||||
HEAD
|
||||
|
||||
QUERY
|
||||
SELECT caldav_data.user_no, caldav_data.dav_etag, caldav_type, logged_user,
|
||||
uid, dtstamp, dtstart at time zone olson_name as dtstart,
|
||||
dtend at time zone olson_name as dtend, due, summary, location,
|
||||
description, priority, class, transp, rrule, url,
|
||||
percent_complete, tz_id, status,
|
||||
caldav_data AS " CalDAV Data", calendar_item.last_modified,
|
||||
dtend - dtstart AS "~Duration"
|
||||
FROM caldav_data LEFT JOIN calendar_item USING(dav_name) LEFT JOIN timezones ON (tz_id=tzid)
|
||||
WHERE caldav_data.dav_name =
|
||||
'/user4/home/RFC5545-Compliance-MONTHLY-Feb.ics';
|
||||
ENDQUERY
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user