1*a1a3b679SAndreas Boehler<?php 2*a1a3b679SAndreas Boehler 3*a1a3b679SAndreas Boehlernamespace Sabre\VObject; 4*a1a3b679SAndreas Boehler 5*a1a3b679SAndreas Boehlerclass EmClientTest extends \PHPUnit_Framework_TestCase { 6*a1a3b679SAndreas Boehler 7*a1a3b679SAndreas Boehler function testParseTz() { 8*a1a3b679SAndreas Boehler 9*a1a3b679SAndreas Boehler $str = 'BEGIN:VCALENDAR 10*a1a3b679SAndreas BoehlerX-WR-CALNAME:Blackhawks Schedule 2011-12 11*a1a3b679SAndreas BoehlerX-APPLE-CALENDAR-COLOR:#E51717 12*a1a3b679SAndreas BoehlerX-WR-TIMEZONE:America/Chicago 13*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN 14*a1a3b679SAndreas BoehlerPRODID:-//eM Client/4.0.13961.0 15*a1a3b679SAndreas BoehlerVERSION:2.0 16*a1a3b679SAndreas BoehlerBEGIN:VTIMEZONE 17*a1a3b679SAndreas BoehlerTZID:America/Chicago 18*a1a3b679SAndreas BoehlerBEGIN:DAYLIGHT 19*a1a3b679SAndreas BoehlerTZOFFSETFROM:-0600 20*a1a3b679SAndreas BoehlerRRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3 21*a1a3b679SAndreas BoehlerDTSTART:20070311T020000 22*a1a3b679SAndreas BoehlerTZNAME:CDT 23*a1a3b679SAndreas BoehlerTZOFFSETTO:-0500 24*a1a3b679SAndreas BoehlerEND:DAYLIGHT 25*a1a3b679SAndreas BoehlerBEGIN:STANDARD 26*a1a3b679SAndreas BoehlerTZOFFSETFROM:-0500 27*a1a3b679SAndreas BoehlerRRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11 28*a1a3b679SAndreas BoehlerDTSTART:20071104T020000 29*a1a3b679SAndreas BoehlerTZNAME:CST 30*a1a3b679SAndreas BoehlerTZOFFSETTO:-0600 31*a1a3b679SAndreas BoehlerEND:STANDARD 32*a1a3b679SAndreas BoehlerEND:VTIMEZONE 33*a1a3b679SAndreas BoehlerBEGIN:VEVENT 34*a1a3b679SAndreas BoehlerCREATED:20110624T181236Z 35*a1a3b679SAndreas BoehlerUID:be3bbfff-96e8-4c66-9908-ab791a62231d 36*a1a3b679SAndreas BoehlerDTEND;TZID="America/Chicago":20111008T223000 37*a1a3b679SAndreas BoehlerTRANSP:OPAQUE 38*a1a3b679SAndreas BoehlerSUMMARY:Stars @ Blackhawks (Home Opener) 39*a1a3b679SAndreas BoehlerDTSTART;TZID="America/Chicago":20111008T193000 40*a1a3b679SAndreas BoehlerDTSTAMP:20120330T013232Z 41*a1a3b679SAndreas BoehlerSEQUENCE:2 42*a1a3b679SAndreas BoehlerX-MICROSOFT-CDO-BUSYSTATUS:BUSY 43*a1a3b679SAndreas BoehlerLAST-MODIFIED:20120330T013237Z 44*a1a3b679SAndreas BoehlerCLASS:PUBLIC 45*a1a3b679SAndreas BoehlerEND:VEVENT 46*a1a3b679SAndreas BoehlerEND:VCALENDAR'; 47*a1a3b679SAndreas Boehler 48*a1a3b679SAndreas Boehler $vObject = Reader::read($str); 49*a1a3b679SAndreas Boehler $dt = $vObject->VEVENT->DTSTART->getDateTime(); 50*a1a3b679SAndreas Boehler $this->assertEquals(new \DateTime('2011-10-08 19:30:00', new \DateTimeZone('America/Chicago')), $dt); 51*a1a3b679SAndreas Boehler 52*a1a3b679SAndreas Boehler } 53*a1a3b679SAndreas Boehler 54*a1a3b679SAndreas Boehler} 55*a1a3b679SAndreas Boehler 56