-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ITip\Broker: handle timezones in replies to exception events
Co-authored-by: Luc DUZAN <[email protected]>
- Loading branch information
Showing
2 changed files
with
192 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,6 +253,75 @@ public function testReplyPartyCrasher(): void | |
$this->process($itip, $old, $expected); | ||
} | ||
|
||
public function testReplyExistingExceptionRecurrenceIdInUTC(): void | ||
{ | ||
// This is a reply to 1 instance of a recurring event. This should | ||
// automatically create an exception. | ||
$itip = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
METHOD:REPLY | ||
BEGIN:VEVENT | ||
ATTENDEE;PARTSTAT=ACCEPTED:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
SEQUENCE:2 | ||
RECURRENCE-ID:20140725T040000Z | ||
UID:foobar | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$old = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
RRULE:FREQ=DAILY | ||
DTSTART;TZID=America/Toronto:20140724T000000 | ||
DTEND;TZID=America/Toronto:20140724T010000 | ||
ATTENDEE:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
DTSTART;TZID=America/Toronto:20140725T000000 | ||
DTEND;TZID=America/Toronto:20140725T010000 | ||
ATTENDEE:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
RECURRENCE-ID;TZID=America/Toronto:20140725T000000 | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$expected = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
RRULE:FREQ=DAILY | ||
DTSTART;TZID=America/Toronto:20140724T000000 | ||
DTEND;TZID=America/Toronto:20140724T010000 | ||
ATTENDEE:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
DTSTART;TZID=America/Toronto:20140725T000000 | ||
DTEND;TZID=America/Toronto:20140725T010000 | ||
ATTENDEE;PARTSTAT=ACCEPTED;SCHEDULE-STATUS=2.0:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
RECURRENCE-ID;TZID=America/Toronto:20140725T000000 | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$this->process($itip, $old, $expected); | ||
} | ||
|
||
public function testReplyNewException(): void | ||
{ | ||
// This is a reply to 1 instance of a recurring event. This should | ||
|
@@ -373,6 +442,126 @@ public function testReplyNewExceptionTz(): void | |
$this->process($itip, $old, $expected); | ||
} | ||
|
||
public function testReplyNewExceptionRecurrenceIdInDifferentTz(): void | ||
{ | ||
// This is a reply to 1 instance of a recurring event. This should | ||
// automatically create an exception. | ||
$itip = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
METHOD:REPLY | ||
BEGIN:VEVENT | ||
ATTENDEE;PARTSTAT=ACCEPTED:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
SEQUENCE:2 | ||
RECURRENCE-ID;TZID=Asia/Ho_Chi_Minh:20140725T110000 | ||
UID:foobar | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$old = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
RRULE:FREQ=DAILY | ||
DTSTART;TZID=America/Toronto:20140724T000000 | ||
DTEND;TZID=America/Toronto:20140724T010000 | ||
ATTENDEE:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$expected = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
RRULE:FREQ=DAILY | ||
DTSTART;TZID=America/Toronto:20140724T000000 | ||
DTEND;TZID=America/Toronto:20140724T010000 | ||
ATTENDEE:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
DTSTART;TZID=America/Toronto:20140725T000000 | ||
DTEND;TZID=America/Toronto:20140725T010000 | ||
ATTENDEE;PARTSTAT=ACCEPTED:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
RECURRENCE-ID;TZID=America/Toronto:20140725T000000 | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$this->process($itip, $old, $expected); | ||
} | ||
|
||
public function testReplyNewExceptionRecurrenceIdInUTC(): void | ||
{ | ||
// This is a reply to 1 instance of a recurring event. This should | ||
// automatically create an exception. | ||
$itip = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
METHOD:REPLY | ||
BEGIN:VEVENT | ||
ATTENDEE;PARTSTAT=ACCEPTED:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
SEQUENCE:2 | ||
RECURRENCE-ID:20140725T040000Z | ||
UID:foobar | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$old = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
RRULE:FREQ=DAILY | ||
DTSTART;TZID=America/Toronto:20140724T000000 | ||
DTEND;TZID=America/Toronto:20140724T010000 | ||
ATTENDEE:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$expected = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
RRULE:FREQ=DAILY | ||
DTSTART;TZID=America/Toronto:20140724T000000 | ||
DTEND;TZID=America/Toronto:20140724T010000 | ||
ATTENDEE:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
SEQUENCE:2 | ||
UID:foobar | ||
DTSTART;TZID=America/Toronto:20140725T000000 | ||
DTEND;TZID=America/Toronto:20140725T010000 | ||
ATTENDEE;PARTSTAT=ACCEPTED:mailto:[email protected] | ||
ORGANIZER:mailto:[email protected] | ||
RECURRENCE-ID;TZID=America/Toronto:20140725T000000 | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$this->process($itip, $old, $expected); | ||
} | ||
|
||
public function testReplyPartyCrashCreateException(): void | ||
{ | ||
// IN this test there's a recurring event that has an exception. The | ||
|