Пример #1
0
 function testGetDateTimeCached()
 {
     $tz = new \DateTimeZone('Europe/Amsterdam');
     $dt = new \DateTime('1985-07-04 01:30:00', $tz);
     $dt->setTimeZone($tz);
     $elem = $this->vcal->createProperty('DTSTART');
     $elem->setDateTime($dt);
     $this->assertEquals($elem->getDateTime(), $dt);
 }
Пример #2
0
 function testSetParts()
 {
     $tz = new \DateTimeZone('Europe/Amsterdam');
     $dt1 = new \DateTime('1985-07-04 01:30:00', $tz);
     $dt2 = new \DateTime('1985-07-04 02:30:00', $tz);
     $dt1->setTimeZone($tz);
     $dt2->setTimeZone($tz);
     $elem = $this->vcal->createProperty('DTSTART');
     $elem->setParts([$dt1, $dt2]);
     $this->assertEquals('19850704T013000,19850704T023000', (string) $elem);
     $this->assertEquals('Europe/Amsterdam', (string) $elem['TZID']);
     $this->assertNull($elem['VALUE']);
     $this->assertTrue($elem->hasTime());
 }