annotate vendor/sabre/vobject/tests/VObject/Property/ICalendar/DurationTest.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject\Property\ICalendar;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 use Sabre\VObject\Component\VCalendar;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6 use Sabre\VObject\Component\VEvent;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8 class DurationTest extends \PHPUnit_Framework_TestCase {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10 function testGetDateInterval() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12 $vcal = new VCalendar();
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13 $event = $vcal->add('VEVENT', array('DURATION' => array('PT1H')));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 new \DateInterval('PT1H'),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17 $event->{'DURATION'}->getDateInterval()
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 }