コード例 #1
0
 /**
  * Timezones should be accessible individually by getTimezone()
  */
 public function testGetTimezone()
 {
     $cal = new qCal_Component_Vcalendar();
     $useastern = new qCal_Component_Vtimezone(array('tzid' => 'US-Eastern'));
     // fake us eastern timezone
     $useastern->attach(new qCal_Component_Standard(array('dtstart' => qCal_DateTime::factory('20090913T000000Z'), 'offsetto' => new qCal_Property_Tzoffsetto('0200'), 'offsetfrom' => new qCal_Property_Tzoffsetfrom('0400'))));
     $uswestern = new qCal_Component_Vtimezone(array('tzid' => 'US-Western'));
     // fake us western timezone
     $uswestern->attach(new qCal_Component_Standard(array('dtstart' => qCal_DateTime::factory('20090913T000000Z'), 'offsetto' => new qCal_Property_Tzoffsetto('0100'), 'offsetfrom' => new qCal_Property_Tzoffsetfrom('0300'))));
     $cal->attach($useastern);
     $cal->attach($uswestern);
     $this->assertIdentical($cal->getTimezone('us-eastern'), $useastern);
 }