ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
BrokerTimezoneInParseEventInfoWithoutMasterTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\VObject\ITip;
4 
7 
9 
11  {
12  $calendar = <<<ICS
13 BEGIN:VCALENDAR
14 VERSION:2.0
15 PRODID:-//Apple Inc.//Mac OS X 10.9.5//EN
16 CALSCALE:GREGORIAN
17 BEGIN:VTIMEZONE
18 TZID:Europe/Minsk
19 BEGIN:DAYLIGHT
20 TZOFFSETFROM:+0200
21 RRULE:FREQ=YEARLY;UNTIL=20100328T000000Z;BYMONTH=3;BYDAY=-1SU
22 DTSTART:19930328T020000
23 TZNAME:GMT+3
24 TZOFFSETTO:+0300
25 END:DAYLIGHT
26 BEGIN:STANDARD
27 TZOFFSETFROM:+0200
28 DTSTART:20110327T020000
29 TZNAME:GMT+3
30 TZOFFSETTO:+0300
31 RDATE:20110327T020000
32 END:STANDARD
33 END:VTIMEZONE
34 BEGIN:VEVENT
35 CREATED:20160331T163031Z
36 UID:B9301437-417C-4136-8DB3-8D1555863791
37 DTEND;TZID=Europe/Minsk:20160405T100000
38 TRANSP:OPAQUE
39 ATTENDEE;CN=User Invitee;CUTYPE=INDIVIDUAL;EMAIL=invitee@test.com;PARTSTAT=
40  ACCEPTED;ROLE=REQ-PARTICIPANT:mailto:invitee@test.com
41 ATTENDEE;CN=User Organizer;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:mailto:organ
42  izer@test.com
43 SUMMARY:Event title
44 DTSTART;TZID=Europe/Minsk:20160405T090000
45 DTSTAMP:20160331T164108Z
46 ORGANIZER;CN=User Organizer:mailto:organizer@test.com
47 SEQUENCE:6
48 RECURRENCE-ID;TZID=Europe/Minsk:20160405T090000
49 END:VEVENT
50 BEGIN:VEVENT
51 CREATED:20160331T163031Z
52 UID:B9301437-417C-4136-8DB3-8D1555863791
53 DTEND;TZID=Europe/Minsk:20160406T100000
54 TRANSP:OPAQUE
55 ATTENDEE;CN=User Invitee;CUTYPE=INDIVIDUAL;EMAIL=invitee@test.com;PARTSTAT=
56  ACCEPTED;ROLE=REQ-PARTICIPANT:mailto:invitee@test.com
57 ATTENDEE;CN=User Organizer;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:mailto:organ
58  izer@test.com
59 SUMMARY:Event title
60 DTSTART;TZID=Europe/Minsk:20160406T090000
61 DTSTAMP:20160331T165845Z
62 ORGANIZER;CN=User Organizer:mailto:organizer@test.com
63 SEQUENCE:6
64 RECURRENCE-ID;TZID=Europe/Minsk:20160406T090000
65 END:VEVENT
66 END:VCALENDAR
67 ICS;
68 
70  $broker = new Broker();
71 
72  $reflectionMethod = new \ReflectionMethod($broker, 'parseEventInfo');
73  $reflectionMethod->setAccessible(true);
74  $data = $reflectionMethod->invoke($broker, $calendar);
75  $this->assertInstanceOf('DateTimeZone', $data['timezone']);
76  $this->assertEquals($data['timezone']->getName(), 'Europe/Minsk');
77  }
78 }
The ITip class is a utility class that helps with processing so-called iTip messages.
Definition: Broker.php:38
test()
Definition: build.php:107
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
$data
Definition: bench.php:6