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

Public Member Functions

 testGeneratorBaseObject ()
 
 testInvalidArg ()
 InvalidArgumentException More...
 
 assertFreeBusyReport ($expected, $input, $timeZone=null, $vavailability=null)
 This function takes a list of objects (icalendar objects), and turns them into a freebusy report. More...
 
 testSimple ()
 
 testSource ()
 
 testOpaque ()
 Testing TRANSP:OPAQUE. More...
 
 testTransparent ()
 Testing TRANSP:TRANSPARENT. More...
 
 testCancelled ()
 Testing STATUS:CANCELLED. More...
 
 testTentative ()
 Testing STATUS:TENTATIVE. More...
 
 testOutsideTimeRange ()
 Testing an event that falls outside of the report time-range. More...
 
 testOutsideTimeRange2 ()
 Testing an event that falls outside of the report time-range. More...
 
 testDuration ()
 Testing an event that uses DURATION. More...
 
 testAllDay ()
 Testing an all-day event. More...
 
 testNoDuration ()
 Testing an event that has no end or duration. More...
 
 testObject ()
 Testing feeding the freebusy generator an object instead of a string. More...
 
 testVFreeBusy ()
 Testing feeding VFREEBUSY objects instead of VEVENT. More...
 
 testYearlyRecurrence ()
 
 testYearlyRecurrenceDuration ()
 
 testFloatingTime ()
 
 testFloatingTimeReferenceTimeZone ()
 
 testAllDay2 ()
 
 testAllDayReferenceTimeZone ()
 
 testNoValidInstances ()
 
 testVAvailabilitySimple ()
 This VAVAILABILITY object overlaps with the time-range, but we're just busy the entire time. More...
 
 testVAvailabilityIrrelevant ()
 This VAVAILABILITY object does not overlap at all with the freebusy report, so it should be ignored. More...
 
 testVAvailabilityOfficeHours ()
 This VAVAILABILITY object has a 9am-5pm AVAILABLE object for office hours. More...
 
 testVAvailabilityOfficeHoursVacation ()
 This test has the same office hours, but has a vacation blocked off for the relevant time, using a higher priority. More...
 
 testVAvailabilityOfficeHoursVacation2 ()
 This test has the same input as the last, except somebody mixed up the PRIORITY values. More...
 

Detailed Description

Definition at line 7 of file FreeBusyGeneratorTest.php.

Member Function Documentation

◆ assertFreeBusyReport()

Sabre\VObject\FreeBusyGeneratorTest::assertFreeBusyReport (   $expected,
  $input,
  $timeZone = null,
  $vavailability = null 
)

This function takes a list of objects (icalendar objects), and turns them into a freebusy report.

Then it takes the expected output and compares it to what we actually got.

It only generates the freebusy report for the following time-range: 2011-01-01 11:00:00 until 2011-01-03 11:11:11

Parameters
string$expected
array$input
string | null$timeZone
string$vavailability
Returns
void

Definition at line 55 of file FreeBusyGeneratorTest.php.

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

Referenced by Sabre\VObject\FreeBusyGeneratorTest\testAllDay(), Sabre\VObject\FreeBusyGeneratorTest\testAllDay2(), Sabre\VObject\FreeBusyGeneratorTest\testAllDayReferenceTimeZone(), Sabre\VObject\FreeBusyGeneratorTest\testCancelled(), Sabre\VObject\FreeBusyGeneratorTest\testDuration(), Sabre\VObject\FreeBusyGeneratorTest\testFloatingTime(), Sabre\VObject\FreeBusyGeneratorTest\testFloatingTimeReferenceTimeZone(), Sabre\VObject\FreeBusyGeneratorTest\testNoDuration(), Sabre\VObject\FreeBusyGeneratorTest\testNoValidInstances(), Sabre\VObject\FreeBusyGeneratorTest\testObject(), Sabre\VObject\FreeBusyGeneratorTest\testOpaque(), Sabre\VObject\FreeBusyGeneratorTest\testOutsideTimeRange(), Sabre\VObject\FreeBusyGeneratorTest\testOutsideTimeRange2(), Sabre\VObject\FreeBusyGeneratorTest\testSimple(), Sabre\VObject\FreeBusyGeneratorTest\testSource(), Sabre\VObject\FreeBusyGeneratorTest\testTentative(), Sabre\VObject\FreeBusyGeneratorTest\testTransparent(), Sabre\VObject\FreeBusyGeneratorTest\testVAvailabilityIrrelevant(), Sabre\VObject\FreeBusyGeneratorTest\testVAvailabilityOfficeHours(), Sabre\VObject\FreeBusyGeneratorTest\testVAvailabilityOfficeHoursVacation(), Sabre\VObject\FreeBusyGeneratorTest\testVAvailabilityOfficeHoursVacation2(), Sabre\VObject\FreeBusyGeneratorTest\testVAvailabilitySimple(), Sabre\VObject\FreeBusyGeneratorTest\testVFreeBusy(), Sabre\VObject\FreeBusyGeneratorTest\testYearlyRecurrence(), and Sabre\VObject\FreeBusyGeneratorTest\testYearlyRecurrenceDuration().

55  {
56 
57  $gen = new FreeBusyGenerator(
58  new \DateTime('20110101T110000Z', new \DateTimeZone('UTC')),
59  new \DateTime('20110103T110000Z', new \DateTimeZone('UTC')),
60  $input,
61  $timeZone
62  );
63 
64  if ($vavailability) {
65  if (is_string($vavailability)) {
66  $vavailability = Reader::read($vavailability);
67  }
68  $gen->setVAvailability($vavailability);
69  }
70 
71  $output = $gen->getResult();
72 
73  // Removing DTSTAMP because it changes every time.
74  unset($output->VFREEBUSY->DTSTAMP);
75 
76  $expected = <<<ICS
77 BEGIN:VCALENDAR
78 VERSION:2.0
79 BEGIN:VFREEBUSY
80 DTSTART:20110101T110000Z
81 DTEND:20110103T110000Z
82 $expected
83 END:VFREEBUSY
84 END:VCALENDAR
85 ICS;
86 
87  $this->assertVObjectEqualsVObject($expected, $output);
88 
89  }
if($argc< 3) $input
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testAllDay()

Sabre\VObject\FreeBusyGeneratorTest::testAllDay ( )

Testing an all-day event.

Definition at line 301 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

301  {
302 
303  // Day-long event, shows up
304  $blob = <<<ICS
305 BEGIN:VCALENDAR
306 BEGIN:VEVENT
307 UID:foobar9
308 DTSTART;VALUE=DATE:20110102
309 END:VEVENT
310 END:VCALENDAR
311 ICS;
312 
313  $this->assertFreeBusyReport(
314  'FREEBUSY:20110102T000000Z/20110103T000000Z',
315  $blob
316  );
317 
318  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testAllDay2()

Sabre\VObject\FreeBusyGeneratorTest::testAllDay2 ( )

Definition at line 475 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

475  {
476 
477  // All-day event, slightly outside of the VFREEBUSY range.
478  $blob = <<<ICS
479 BEGIN:VCALENDAR
480 BEGIN:VEVENT
481 UID:foobar
482 DTSTART;VALUE=DATE:20110101
483 END:VEVENT
484 END:VCALENDAR
485 ICS;
486 
487  $this->assertFreeBusyReport(
488  "FREEBUSY:20110101T110000Z/20110102T000000Z",
489  $blob
490  );
491 
492  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testAllDayReferenceTimeZone()

Sabre\VObject\FreeBusyGeneratorTest::testAllDayReferenceTimeZone ( )

Definition at line 494 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

494  {
495 
496  // All-day event + reference timezone
497  $blob = <<<ICS
498 BEGIN:VCALENDAR
499 BEGIN:VEVENT
500 UID:foobar
501 DTSTART;VALUE=DATE:20110101
502 END:VEVENT
503 END:VCALENDAR
504 ICS;
505 
506  $this->assertFreeBusyReport(
507  "FREEBUSY:20110101T110000Z/20110102T050000Z",
508  $blob,
509  new \DateTimeZone('America/Toronto')
510  );
511 
512  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testCancelled()

Sabre\VObject\FreeBusyGeneratorTest::testCancelled ( )

Testing STATUS:CANCELLED.

Definition at line 184 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

184  {
185 
186  // transparent, hidden
187  $blob = <<<ICS
188 BEGIN:VCALENDAR
189 BEGIN:VEVENT
190 UID:foobar4
191 STATUS:CANCELLED
192 DTSTART:20110101T160000Z
193 DTEND:20110101T170000Z
194 END:VEVENT
195 END:VCALENDAR
196 ICS;
197 
198  $this->assertFreeBusyReport(
199  "",
200  $blob
201  );
202 
203  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testDuration()

Sabre\VObject\FreeBusyGeneratorTest::testDuration ( )

Testing an event that uses DURATION.

Definition at line 278 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

278  {
279 
280  // using duration, shows up
281  $blob = <<<ICS
282 BEGIN:VCALENDAR
283 BEGIN:VEVENT
284 UID:foobar8
285 DTSTART:20110101T190000Z
286 DURATION:PT1H
287 END:VEVENT
288 END:VCALENDAR
289 ICS;
290 
291  $this->assertFreeBusyReport(
292  'FREEBUSY:20110101T190000Z/20110101T200000Z',
293  $blob
294  );
295 
296  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testFloatingTime()

Sabre\VObject\FreeBusyGeneratorTest::testFloatingTime ( )

Definition at line 434 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

434  {
435 
436  // Floating time, no timezone
437  $blob = <<<ICS
438 BEGIN:VCALENDAR
439 BEGIN:VEVENT
440 UID:foobar
441 DTSTART:20110101T120000
442 DTEND:20110101T130000
443 END:VEVENT
444 END:VCALENDAR
445 ICS;
446 
447  $this->assertFreeBusyReport(
448  "FREEBUSY:20110101T120000Z/20110101T130000Z",
449  $blob
450  );
451 
452  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testFloatingTimeReferenceTimeZone()

Sabre\VObject\FreeBusyGeneratorTest::testFloatingTimeReferenceTimeZone ( )

Definition at line 454 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

454  {
455 
456  // Floating time + reference timezone
457  $blob = <<<ICS
458 BEGIN:VCALENDAR
459 BEGIN:VEVENT
460 UID:foobar
461 DTSTART:20110101T120000
462 DTEND:20110101T130000
463 END:VEVENT
464 END:VCALENDAR
465 ICS;
466 
467  $this->assertFreeBusyReport(
468  "FREEBUSY:20110101T170000Z/20110101T180000Z",
469  $blob,
470  new \DateTimeZone('America/Toronto')
471  );
472 
473  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testGeneratorBaseObject()

Sabre\VObject\FreeBusyGeneratorTest::testGeneratorBaseObject ( )

Definition at line 11 of file FreeBusyGeneratorTest.php.

References $result.

11  {
12 
13  $obj = new Component\VCalendar();
14  $obj->METHOD = 'PUBLISH';
15 
16  $gen = new FreeBusyGenerator();
17  $gen->setObjects([]);
18  $gen->setBaseObject($obj);
19 
20  $result = $gen->getResult();
21 
22  $this->assertEquals('PUBLISH', $result->METHOD->getValue());
23 
24  }
$result

◆ testInvalidArg()

Sabre\VObject\FreeBusyGeneratorTest::testInvalidArg ( )

InvalidArgumentException

Definition at line 29 of file FreeBusyGeneratorTest.php.

29  {
30 
31  $gen = new FreeBusyGenerator(
32  new \DateTime('2012-01-01'),
33  new \DateTime('2012-12-31'),
34  new \StdClass()
35  );
36 
37  }

◆ testNoDuration()

Sabre\VObject\FreeBusyGeneratorTest::testNoDuration ( )

Testing an event that has no end or duration.

Definition at line 323 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

323  {
324 
325  // No duration, does not show up
326  $blob = <<<ICS
327 BEGIN:VCALENDAR
328 BEGIN:VEVENT
329 UID:foobar10
330 DTSTART:20110101T200000Z
331 END:VEVENT
332 END:VCALENDAR
333 ICS;
334 
335  $this->assertFreeBusyReport(
336  '',
337  $blob
338  );
339 
340  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testNoValidInstances()

Sabre\VObject\FreeBusyGeneratorTest::testNoValidInstances ( )

Definition at line 514 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

514  {
515 
516  // Recurrence rule with no valid instances
517  $blob = <<<ICS
518 BEGIN:VCALENDAR
519 BEGIN:VEVENT
520 UID:foobar
521 DTSTART:20110101T100000Z
522 DTEND:20110103T120000Z
523 RRULE:FREQ=WEEKLY;COUNT=1
524 EXDATE:20110101T100000Z
525 END:VEVENT
526 END:VCALENDAR
527 ICS;
528 
529  $this->assertFreeBusyReport(
530  "",
531  $blob
532  );
533 
534  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testObject()

Sabre\VObject\FreeBusyGeneratorTest::testObject ( )

Testing feeding the freebusy generator an object instead of a string.

Definition at line 345 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport(), and Sabre\VObject\Reader\read().

345  {
346 
347  // encoded as object, shows up
348  $blob = <<<ICS
349 BEGIN:VCALENDAR
350 BEGIN:VEVENT
351 UID:foobar11
352 DTSTART:20110101T210000Z
353 DURATION:PT1H
354 END:VEVENT
355 END:VCALENDAR
356 ICS;
357 
358  $this->assertFreeBusyReport(
359  'FREEBUSY:20110101T210000Z/20110101T220000Z',
360  Reader::read($blob)
361  );
362 
363 
364  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
+ Here is the call graph for this function:

◆ testOpaque()

Sabre\VObject\FreeBusyGeneratorTest::testOpaque ( )

Testing TRANSP:OPAQUE.

Definition at line 137 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

137  {
138 
139  $blob = <<<ICS
140 BEGIN:VCALENDAR
141 BEGIN:VEVENT
142 UID:foobar2
143 TRANSP:OPAQUE
144 DTSTART:20110101T130000Z
145 DTEND:20110101T140000Z
146 END:VEVENT
147 END:VCALENDAR
148 ICS;
149 
150  $this->assertFreeBusyReport(
151  "FREEBUSY:20110101T130000Z/20110101T140000Z",
152  $blob
153  );
154 
155  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testOutsideTimeRange()

Sabre\VObject\FreeBusyGeneratorTest::testOutsideTimeRange ( )

Testing an event that falls outside of the report time-range.

Definition at line 232 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

232  {
233 
234  // outside of time-range, hidden
235  $blob = <<<ICS
236 BEGIN:VCALENDAR
237 BEGIN:VEVENT
238 UID:foobar6
239 DTSTART:20110101T090000Z
240 DTEND:20110101T100000Z
241 END:VEVENT
242 END:VCALENDAR
243 ICS;
244 
245  $this->assertFreeBusyReport(
246  '',
247  $blob
248  );
249 
250  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testOutsideTimeRange2()

Sabre\VObject\FreeBusyGeneratorTest::testOutsideTimeRange2 ( )

Testing an event that falls outside of the report time-range.

Definition at line 255 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

255  {
256 
257  // outside of time-range, hidden
258  $blob = <<<ICS
259 BEGIN:VCALENDAR
260 BEGIN:VEVENT
261 UID:foobar7
262 DTSTART:20110104T090000Z
263 DTEND:20110104T100000Z
264 END:VEVENT
265 END:VCALENDAR
266 ICS;
267 
268  $this->assertFreeBusyReport(
269  '',
270  $blob
271  );
272 
273  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testSimple()

Sabre\VObject\FreeBusyGeneratorTest::testSimple ( )

Definition at line 91 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

91  {
92 
93  $blob = <<<ICS
94 BEGIN:VCALENDAR
95 BEGIN:VEVENT
96 UID:foobar
97 DTSTART:20110101T120000Z
98 DTEND:20110101T130000Z
99 END:VEVENT
100 END:VCALENDAR
101 ICS;
102 
103 
104  $this->assertFreeBusyReport(
105  "FREEBUSY:20110101T120000Z/20110101T130000Z",
106  $blob
107  );
108 
109  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testSource()

Sabre\VObject\FreeBusyGeneratorTest::testSource ( )

Definition at line 111 of file FreeBusyGeneratorTest.php.

References $h, and Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

111  {
112 
113  $blob = <<<ICS
114 BEGIN:VCALENDAR
115 BEGIN:VEVENT
116 UID:foobar
117 DTSTART:20110101T120000Z
118 DTEND:20110101T130000Z
119 END:VEVENT
120 END:VCALENDAR
121 ICS;
122  $h = fopen('php://memory', 'r+');
123  fwrite($h, $blob);
124  rewind($h);
125 
126 
127  $this->assertFreeBusyReport(
128  "FREEBUSY:20110101T120000Z/20110101T130000Z",
129  $h
130  );
131 
132  }
$h
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testTentative()

Sabre\VObject\FreeBusyGeneratorTest::testTentative ( )

Testing STATUS:TENTATIVE.

Definition at line 208 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

208  {
209 
210  // tentative, shows up
211  $blob = <<<ICS
212 BEGIN:VCALENDAR
213 BEGIN:VEVENT
214 UID:foobar5
215 STATUS:TENTATIVE
216 DTSTART:20110101T180000Z
217 DTEND:20110101T190000Z
218 END:VEVENT
219 END:VCALENDAR
220 ICS;
221 
222  $this->assertFreeBusyReport(
223  'FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T180000Z/20110101T190000Z',
224  $blob
225  );
226 
227  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testTransparent()

Sabre\VObject\FreeBusyGeneratorTest::testTransparent ( )

Testing TRANSP:TRANSPARENT.

Definition at line 160 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

160  {
161 
162  // transparent, hidden
163  $blob = <<<ICS
164 BEGIN:VCALENDAR
165 BEGIN:VEVENT
166 UID:foobar3
167 TRANSP:TRANSPARENT
168 DTSTART:20110101T140000Z
169 DTEND:20110101T150000Z
170 END:VEVENT
171 END:VCALENDAR
172 ICS;
173 
174  $this->assertFreeBusyReport(
175  "",
176  $blob
177  );
178 
179  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testVAvailabilityIrrelevant()

Sabre\VObject\FreeBusyGeneratorTest::testVAvailabilityIrrelevant ( )

This VAVAILABILITY object does not overlap at all with the freebusy report, so it should be ignored.

Definition at line 580 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

580  {
581 
582  $blob = <<<ICS
583 BEGIN:VCALENDAR
584 BEGIN:VEVENT
585 UID:lalala
586 DTSTART:20110101T120000Z
587 DTEND:20110101T130000Z
588 END:VEVENT
589 END:VCALENDAR
590 ICS;
591 
592  $vavail = <<<ICS
593 BEGIN:VCALENDAR
594 BEGIN:VAVAILABILITY
595 DTSTART:20150101T000000Z
596 DTEND:20160101T000000Z
597 BEGIN:AVAILABLE
598 DTSTART:20150101T000000Z
599 DTEND:20150101T010000Z
600 END:AVAILABLE
601 END:VAVAILABILITY
602 END:VCALENDAR
603 ICS;
604 
605  $this->assertFreeBusyReport(
606  "FREEBUSY:20110101T120000Z/20110101T130000Z",
607  $blob,
608  null,
609  $vavail
610  );
611 
612  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testVAvailabilityOfficeHours()

Sabre\VObject\FreeBusyGeneratorTest::testVAvailabilityOfficeHours ( )

This VAVAILABILITY object has a 9am-5pm AVAILABLE object for office hours.

Definition at line 618 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

618  {
619 
620  $blob = <<<ICS
621 BEGIN:VCALENDAR
622 BEGIN:VEVENT
623 UID:lalala
624 DTSTART:20110101T120000Z
625 DTEND:20110101T130000Z
626 END:VEVENT
627 END:VCALENDAR
628 ICS;
629 
630  $vavail = <<<ICS
631 BEGIN:VCALENDAR
632 BEGIN:VAVAILABILITY
633 DTSTART:20100101T000000Z
634 DTEND:20120101T000000Z
635 BUSYTYPE:BUSY-TENTATIVE
636 BEGIN:AVAILABLE
637 DTSTART:20101213T090000Z
638 DTEND:20101213T170000Z
639 RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
640 END:AVAILABLE
641 END:VAVAILABILITY
642 END:VCALENDAR
643 ICS;
644 
645  $this->assertFreeBusyReport(
646  "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\n" .
647  "FREEBUSY:20110101T120000Z/20110101T130000Z\n" .
648  "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\n",
649  $blob,
650  null,
651  $vavail
652  );
653 
654  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testVAvailabilityOfficeHoursVacation()

Sabre\VObject\FreeBusyGeneratorTest::testVAvailabilityOfficeHoursVacation ( )

This test has the same office hours, but has a vacation blocked off for the relevant time, using a higher priority.

(lower number).

Definition at line 660 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

660  {
661 
662  $blob = <<<ICS
663 BEGIN:VCALENDAR
664 BEGIN:VEVENT
665 UID:lalala
666 DTSTART:20110101T120000Z
667 DTEND:20110101T130000Z
668 END:VEVENT
669 END:VCALENDAR
670 ICS;
671 
672  $vavail = <<<ICS
673 BEGIN:VCALENDAR
674 BEGIN:VAVAILABILITY
675 DTSTART:20100101T000000Z
676 DTEND:20120101T000000Z
677 BUSYTYPE:BUSY-TENTATIVE
678 PRIORITY:2
679 BEGIN:AVAILABLE
680 DTSTART:20101213T090000Z
681 DTEND:20101213T170000Z
682 RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
683 END:AVAILABLE
684 END:VAVAILABILITY
685 BEGIN:VAVAILABILITY
686 PRIORITY:1
687 DTSTART:20101214T000000Z
688 DTEND:20110107T000000Z
689 BUSYTYPE:BUSY
690 END:VAVAILABILITY
691 END:VCALENDAR
692 ICS;
693 
694  $this->assertFreeBusyReport(
695  "FREEBUSY:20110101T110000Z/20110103T110000Z",
696  $blob,
697  null,
698  $vavail
699  );
700 
701  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testVAvailabilityOfficeHoursVacation2()

Sabre\VObject\FreeBusyGeneratorTest::testVAvailabilityOfficeHoursVacation2 ( )

This test has the same input as the last, except somebody mixed up the PRIORITY values.

The end-result is that the vacation VAVAILABILITY is completely ignored.

Definition at line 709 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

709  {
710 
711  $blob = <<<ICS
712 BEGIN:VCALENDAR
713 BEGIN:VEVENT
714 UID:lalala
715 DTSTART:20110101T120000Z
716 DTEND:20110101T130000Z
717 END:VEVENT
718 END:VCALENDAR
719 ICS;
720 
721  $vavail = <<<ICS
722 BEGIN:VCALENDAR
723 BEGIN:VAVAILABILITY
724 DTSTART:20100101T000000Z
725 DTEND:20120101T000000Z
726 BUSYTYPE:BUSY-TENTATIVE
727 PRIORITY:1
728 BEGIN:AVAILABLE
729 DTSTART:20101213T090000Z
730 DTEND:20101213T170000Z
731 RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
732 END:AVAILABLE
733 END:VAVAILABILITY
734 BEGIN:VAVAILABILITY
735 PRIORITY:2
736 DTSTART:20101214T000000Z
737 DTEND:20110107T000000Z
738 BUSYTYPE:BUSY
739 END:VAVAILABILITY
740 END:VCALENDAR
741 ICS;
742 
743  $this->assertFreeBusyReport(
744  "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\n" .
745  "FREEBUSY:20110101T120000Z/20110101T130000Z\n" .
746  "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\n",
747  $blob,
748  null,
749  $vavail
750  );
751 
752  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testVAvailabilitySimple()

Sabre\VObject\FreeBusyGeneratorTest::testVAvailabilitySimple ( )

This VAVAILABILITY object overlaps with the time-range, but we're just busy the entire time.

Definition at line 540 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

540  {
541 
542  $blob = <<<ICS
543 BEGIN:VCALENDAR
544 BEGIN:VEVENT
545 UID:lalala
546 DTSTART:20110101T120000Z
547 DTEND:20110101T130000Z
548 END:VEVENT
549 END:VCALENDAR
550 ICS;
551 
552  $vavail = <<<ICS
553 BEGIN:VCALENDAR
554 BEGIN:VAVAILABILITY
555 DTSTART:20110101T000000Z
556 DTEND:20120101T000000Z
557 BEGIN:AVAILABLE
558 DTSTART:20110101T000000Z
559 DTEND:20110101T010000Z
560 END:AVAILABLE
561 END:VAVAILABILITY
562 END:VCALENDAR
563 ICS;
564 
565  $this->assertFreeBusyReport(
566  "FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T110000Z/20110101T120000Z\n" .
567  "FREEBUSY:20110101T120000Z/20110101T130000Z\n" .
568  "FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T130000Z/20110103T110000Z",
569  $blob,
570  null,
571  $vavail
572  );
573 
574  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testVFreeBusy()

Sabre\VObject\FreeBusyGeneratorTest::testVFreeBusy ( )

Testing feeding VFREEBUSY objects instead of VEVENT.

Definition at line 369 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

369  {
370 
371  // Freebusy. Some parts show up
372  $blob = <<<ICS
373 BEGIN:VCALENDAR
374 BEGIN:VFREEBUSY
375 FREEBUSY:20110103T010000Z/20110103T020000Z
376 FREEBUSY;FBTYPE=FREE:20110103T020000Z/20110103T030000Z
377 FREEBUSY:20110103T030000Z/20110103T040000Z,20110103T040000Z/20110103T050000Z
378 FREEBUSY:20120101T000000Z/20120101T010000Z
379 FREEBUSY:20110103T050000Z/PT1H
380 END:VFREEBUSY
381 END:VCALENDAR
382 ICS;
383 
384  $this->assertFreeBusyReport(
385  "FREEBUSY:20110103T010000Z/20110103T020000Z\n" .
386  'FREEBUSY:20110103T030000Z/20110103T060000Z',
387  $blob
388  );
389 
390  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testYearlyRecurrence()

Sabre\VObject\FreeBusyGeneratorTest::testYearlyRecurrence ( )

Definition at line 392 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

392  {
393 
394  // Yearly recurrence rule, shows up
395  $blob = <<<ICS
396 BEGIN:VCALENDAR
397 BEGIN:VEVENT
398 UID:foobar13
399 DTSTART:20100101T220000Z
400 DTEND:20100101T230000Z
401 RRULE:FREQ=YEARLY
402 END:VEVENT
403 END:VCALENDAR
404 ICS;
405 
406  $this->assertFreeBusyReport(
407  'FREEBUSY:20110101T220000Z/20110101T230000Z',
408  $blob
409  );
410 
411  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

◆ testYearlyRecurrenceDuration()

Sabre\VObject\FreeBusyGeneratorTest::testYearlyRecurrenceDuration ( )

Definition at line 413 of file FreeBusyGeneratorTest.php.

References Sabre\VObject\FreeBusyGeneratorTest\assertFreeBusyReport().

413  {
414 
415  // Yearly recurrence rule + duration, shows up
416  $blob = <<<ICS
417 BEGIN:VCALENDAR
418 BEGIN:VEVENT
419 UID:foobar14
420 DTSTART:20100101T230000Z
421 DURATION:PT1H
422 RRULE:FREQ=YEARLY
423 END:VEVENT
424 END:VCALENDAR
425 ICS;
426 
427  $this->assertFreeBusyReport(
428  'FREEBUSY:20110101T230000Z/20110102T000000Z',
429  $blob
430  );
431 
432  }
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report...
+ Here is the call graph for this function:

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