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

Public Member Functions

 testValarm ()
 This test is specifically for a time-range query on a VALARM, contained in a VEVENT that's recurring. More...
 
 testAlarmWayBefore ()
 

Detailed Description

Definition at line 7 of file CalendarQueryVAlarmTest.php.

Member Function Documentation

◆ testAlarmWayBefore()

Sabre\CalDAV\CalendarQueryVAlarmTest::testAlarmWayBefore ( )

Definition at line 76 of file CalendarQueryVAlarmTest.php.

76  {
77 
78  $vcalendar = new VObject\Component\VCalendar();
79 
80  $vevent = $vcalendar->createComponent('VEVENT');
81  $vevent->DTSTART = '20120101T120000Z';
82  $vevent->UID = 'bla';
83 
84  $valarm = $vcalendar->createComponent('VALARM');
85  $valarm->TRIGGER = '-P2W1D';
86  $vevent->add($valarm);
87 
88  $vcalendar->add($vevent);
89 
90  $filter = [
91  'name' => 'VCALENDAR',
92  'is-not-defined' => false,
93  'time-range' => null,
94  'prop-filters' => [],
95  'comp-filters' => [
96  [
97  'name' => 'VEVENT',
98  'is-not-defined' => false,
99  'time-range' => null,
100  'prop-filters' => [],
101  'comp-filters' => [
102  [
103  'name' => 'VALARM',
104  'is-not-defined' => false,
105  'prop-filters' => [],
106  'comp-filters' => [],
107  'time-range' => [
108  'start' => new \DateTime('2011-12-10'),
109  'end' => new \DateTime('2011-12-20'),
110  ],
111  ],
112  ],
113  ],
114  ],
115  ];
116 
117  $validator = new CalendarQueryValidator();
118  $this->assertTrue($validator->validate($vcalendar, $filter));
119 
120  }

◆ testValarm()

Sabre\CalDAV\CalendarQueryVAlarmTest::testValarm ( )

This test is specifically for a time-range query on a VALARM, contained in a VEVENT that's recurring.

Definition at line 13 of file CalendarQueryVAlarmTest.php.

13  {
14 
15  $vcalendar = new VObject\Component\VCalendar();
16 
17  $vevent = $vcalendar->createComponent('VEVENT');
18  $vevent->RRULE = 'FREQ=MONTHLY';
19  $vevent->DTSTART = '20120101T120000Z';
20  $vevent->UID = 'bla';
21 
22  $valarm = $vcalendar->createComponent('VALARM');
23  $valarm->TRIGGER = '-P15D';
24  $vevent->add($valarm);
25 
26 
27  $vcalendar->add($vevent);
28 
29  $filter = [
30  'name' => 'VCALENDAR',
31  'is-not-defined' => false,
32  'time-range' => null,
33  'prop-filters' => [],
34  'comp-filters' => [
35  [
36  'name' => 'VEVENT',
37  'is-not-defined' => false,
38  'time-range' => null,
39  'prop-filters' => [],
40  'comp-filters' => [
41  [
42  'name' => 'VALARM',
43  'is-not-defined' => false,
44  'prop-filters' => [],
45  'comp-filters' => [],
46  'time-range' => [
47  'start' => new \DateTime('2012-05-10'),
48  'end' => new \DateTime('2012-05-20'),
49  ],
50  ],
51  ],
52  ],
53  ],
54  ];
55 
56  $validator = new CalendarQueryValidator();
57  $this->assertTrue($validator->validate($vcalendar, $filter));
58 
59  $vcalendar = new VObject\Component\VCalendar();
60 
61  // A limited recurrence rule, should return false
62  $vevent = $vcalendar->createComponent('VEVENT');
63  $vevent->RRULE = 'FREQ=MONTHLY;COUNT=1';
64  $vevent->DTSTART = '20120101T120000Z';
65  $vevent->UID = 'bla';
66 
67  $valarm = $vcalendar->createComponent('VALARM');
68  $valarm->TRIGGER = '-P15D';
69  $vevent->add($valarm);
70 
71  $vcalendar->add($vevent);
72 
73  $this->assertFalse($validator->validate($vcalendar, $filter));
74  }

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