ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\VObject\Component\VFreeBusyTest Class Reference
+ Inheritance diagram for Sabre\VObject\Component\VFreeBusyTest:
+ Collaboration diagram for Sabre\VObject\Component\VFreeBusyTest:

Public Member Functions

 testIsFree ()
 
 testValidate ()
 

Detailed Description

Definition at line 9 of file VFreeBusyTest.php.

Member Function Documentation

◆ testIsFree()

Sabre\VObject\Component\VFreeBusyTest::testIsFree ( )

Definition at line 11 of file VFreeBusyTest.php.

11 {
12
13 $input = <<<BLA
14BEGIN:VCALENDAR
15BEGIN:VFREEBUSY
16FREEBUSY;FBTYPE=FREE:20120912T000500Z/PT1H
17FREEBUSY;FBTYPE=BUSY:20120912T010000Z/20120912T020000Z
18FREEBUSY;FBTYPE=BUSY-TENTATIVE:20120912T020000Z/20120912T030000Z
19FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20120912T030000Z/20120912T040000Z
20FREEBUSY;FBTYPE=BUSY:20120912T050000Z/20120912T060000Z,20120912T080000Z/20120912T090000Z
21FREEBUSY;FBTYPE=BUSY:20120912T100000Z/PT1H
22END:VFREEBUSY
23END:VCALENDAR
24BLA;
25
27 $vfb = $obj->VFREEBUSY;
28
29 $tz = new \DateTimeZone('UTC');
30
31 $this->assertFalse($vfb->isFree(new \DateTime('2012-09-12 01:15:00', $tz), new \DateTime('2012-09-12 01:45:00', $tz)));
32 $this->assertFalse($vfb->isFree(new \DateTime('2012-09-12 08:05:00', $tz), new \DateTime('2012-09-12 08:10:00', $tz)));
33 $this->assertFalse($vfb->isFree(new \DateTime('2012-09-12 10:15:00', $tz), new \DateTime('2012-09-12 10:45:00', $tz)));
34
35 // Checking whether the end time is treated as non-inclusive
36 $this->assertTrue($vfb->isFree(new \DateTime('2012-09-12 09:00:00', $tz), new \DateTime('2012-09-12 09:15:00', $tz)));
37 $this->assertTrue($vfb->isFree(new \DateTime('2012-09-12 09:45:00', $tz), new \DateTime('2012-09-12 10:00:00', $tz)));
38 $this->assertTrue($vfb->isFree(new \DateTime('2012-09-12 11:00:00', $tz), new \DateTime('2012-09-12 12:00:00', $tz)));
39
40 }
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
foreach($paths as $path) if($argc< 3) $input

References Sabre\VObject\$input, $tz, and Sabre\VObject\Reader\read().

+ Here is the call graph for this function:

◆ testValidate()

Sabre\VObject\Component\VFreeBusyTest::testValidate ( )

Definition at line 42 of file VFreeBusyTest.php.

42 {
43
44 $input = <<<HI
45BEGIN:VCALENDAR
46VERSION:2.0
47PRODID:YoYo
48BEGIN:VFREEBUSY
49UID:some-random-id
50DTSTAMP:20140402T180200Z
51END:VFREEBUSY
52END:VCALENDAR
53HI;
54
55 $obj = Reader::read($input);
56
57 $warnings = $obj->validate();
58 $messages = [];
59 foreach ($warnings as $warning) {
60 $messages[] = $warning['message'];
61 }
62
63 $this->assertEquals([], $messages);
64
65 }
$warning
Definition: X509warning.php:13
$messages
Definition: en.php:5

References Sabre\VObject\$input, $messages, $warning, $warnings, and Sabre\VObject\Reader\read().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: