1<?php
2
3namespace Sabre\VObject;
4
5class EmClientTest extends \PHPUnit_Framework_TestCase {
6
7    function testParseTz() {
8
9        $str = 'BEGIN:VCALENDAR
10X-WR-CALNAME:Blackhawks Schedule 2011-12
11X-APPLE-CALENDAR-COLOR:#E51717
12X-WR-TIMEZONE:America/Chicago
13CALSCALE:GREGORIAN
14PRODID:-//eM Client/4.0.13961.0
15VERSION:2.0
16BEGIN:VTIMEZONE
17TZID:America/Chicago
18BEGIN:DAYLIGHT
19TZOFFSETFROM:-0600
20RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
21DTSTART:20070311T020000
22TZNAME:CDT
23TZOFFSETTO:-0500
24END:DAYLIGHT
25BEGIN:STANDARD
26TZOFFSETFROM:-0500
27RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
28DTSTART:20071104T020000
29TZNAME:CST
30TZOFFSETTO:-0600
31END:STANDARD
32END:VTIMEZONE
33BEGIN:VEVENT
34CREATED:20110624T181236Z
35UID:be3bbfff-96e8-4c66-9908-ab791a62231d
36DTEND;TZID="America/Chicago":20111008T223000
37TRANSP:OPAQUE
38SUMMARY:Stars @ Blackhawks (Home Opener)
39DTSTART;TZID="America/Chicago":20111008T193000
40DTSTAMP:20120330T013232Z
41SEQUENCE:2
42X-MICROSOFT-CDO-BUSYSTATUS:BUSY
43LAST-MODIFIED:20120330T013237Z
44CLASS:PUBLIC
45END:VEVENT
46END:VCALENDAR';
47
48        $vObject = Reader::read($str);
49        $dt = $vObject->VEVENT->DTSTART->getDateTime();
50        $this->assertEquals(new \DateTime('2011-10-08 19:30:00', new \DateTimeZone('America/Chicago')), $dt);
51
52    }
53
54}
55
56