5use PHPUnit\Framework\TestCase;
13 $obj =
new Component\VCalendar();
14 $obj->METHOD =
'PUBLISH';
18 $gen->setBaseObject($obj);
22 $this->assertEquals(
'PUBLISH',
$result->METHOD->getValue());
32 new \DateTime(
'2012-01-01'),
33 new \DateTime(
'2012-12-31'),
58 new \DateTime(
'20110101T110000Z',
new \DateTimeZone(
'UTC')),
59 new \DateTime(
'20110103T110000Z',
new \DateTimeZone(
'UTC')),
65 if (is_string($vavailability)) {
68 $gen->setVAvailability($vavailability);
74 unset(
$output->VFREEBUSY->DTSTAMP);
80DTSTART:20110101T110000Z
87 $this->assertVObjectEqualsVObject($expected,
$output);
97DTSTART:20110101T120000Z
105 "FREEBUSY:20110101T120000Z/20110101T130000Z",
117DTSTART:20110101T120000Z
118DTEND:20110101T130000Z
122 $h = fopen(
'php://memory',
'r+');
128 "FREEBUSY:20110101T120000Z/20110101T130000Z",
144DTSTART:20110101T130000Z
145DTEND:20110101T140000Z
151 "FREEBUSY:20110101T130000Z/20110101T140000Z",
168DTSTART:20110101T140000Z
169DTEND:20110101T150000Z
192DTSTART:20110101T160000Z
193DTEND:20110101T170000Z
216DTSTART:20110101T180000Z
217DTEND:20110101T190000Z
223 'FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T180000Z/20110101T190000Z',
239DTSTART:20110101T090000Z
240DTEND:20110101T100000Z
262DTSTART:20110104T090000Z
263DTEND:20110104T100000Z
285DTSTART:20110101T190000Z
292 'FREEBUSY:20110101T190000Z/20110101T200000Z',
308DTSTART;VALUE=DATE:20110102
314 'FREEBUSY:20110102T000000Z/20110103T000000Z',
330DTSTART:20110101T200000Z
352DTSTART:20110101T210000Z
359 'FREEBUSY:20110101T210000Z/20110101T220000Z',
375FREEBUSY:20110103T010000Z/20110103T020000Z
376FREEBUSY;FBTYPE=FREE:20110103T020000Z/20110103T030000Z
377FREEBUSY:20110103T030000Z/20110103T040000Z,20110103T040000Z/20110103T050000Z
378FREEBUSY:20120101T000000Z/20120101T010000Z
379FREEBUSY:20110103T050000Z/PT1H
385 "FREEBUSY:20110103T010000Z/20110103T020000Z\n" .
386 'FREEBUSY:20110103T030000Z/20110103T060000Z',
399DTSTART:20100101T220000Z
400DTEND:20100101T230000Z
407 'FREEBUSY:20110101T220000Z/20110101T230000Z',
420DTSTART:20100101T230000Z
428 'FREEBUSY:20110101T230000Z/20110102T000000Z',
441DTSTART:20110101T120000
448 "FREEBUSY:20110101T120000Z/20110101T130000Z",
461DTSTART:20110101T120000
468 "FREEBUSY:20110101T170000Z/20110101T180000Z",
470 new \DateTimeZone(
'America/Toronto')
482DTSTART;VALUE=DATE:20110101
488 "FREEBUSY:20110101T110000Z/20110102T000000Z",
501DTSTART;VALUE=DATE:20110101
507 "FREEBUSY:20110101T110000Z/20110102T050000Z",
509 new \DateTimeZone(
'America/Toronto')
521DTSTART:20110101T100000Z
522DTEND:20110103T120000Z
523RRULE:FREQ=WEEKLY;COUNT=1
524EXDATE:20110101T100000Z
546DTSTART:20110101T120000Z
547DTEND:20110101T130000Z
555DTSTART:20110101T000000Z
556DTEND:20120101T000000Z
558DTSTART:20110101T000000Z
559DTEND:20110101T010000Z
566 "FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T110000Z/20110101T120000Z\n" .
567 "FREEBUSY:20110101T120000Z/20110101T130000Z\n" .
568 "FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T130000Z/20110103T110000Z",
586DTSTART:20110101T120000Z
587DTEND:20110101T130000Z
595DTSTART:20150101T000000Z
596DTEND:20160101T000000Z
598DTSTART:20150101T000000Z
599DTEND:20150101T010000Z
606 "FREEBUSY:20110101T120000Z/20110101T130000Z",
624DTSTART:20110101T120000Z
625DTEND:20110101T130000Z
633DTSTART:20100101T000000Z
634DTEND:20120101T000000Z
635BUSYTYPE:BUSY-TENTATIVE
637DTSTART:20101213T090000Z
638DTEND:20101213T170000Z
639RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
646 "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\n" .
647 "FREEBUSY:20110101T120000Z/20110101T130000Z\n" .
648 "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\n",
666DTSTART:20110101T120000Z
667DTEND:20110101T130000Z
675DTSTART:20100101T000000Z
676DTEND:20120101T000000Z
677BUSYTYPE:BUSY-TENTATIVE
680DTSTART:20101213T090000Z
681DTEND:20101213T170000Z
682RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
687DTSTART:20101214T000000Z
688DTEND:20110107T000000Z
695 "FREEBUSY:20110101T110000Z/20110103T110000Z",
715DTSTART:20110101T120000Z
716DTEND:20110101T130000Z
724DTSTART:20100101T000000Z
725DTEND:20120101T000000Z
726BUSYTYPE:BUSY-TENTATIVE
729DTSTART:20101213T090000Z
730DTEND:20101213T170000Z
731RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
736DTSTART:20101214T000000Z
737DTEND:20110107T000000Z
744 "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\n" .
745 "FREEBUSY:20110101T120000Z/20110101T130000Z\n" .
746 "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\n",
An exception for terminatinating execution or to throw for unit testing.
testVAvailabilitySimple()
This VAVAILABILITY object overlaps with the time-range, but we're just busy the entire time.
testVAvailabilityOfficeHoursVacation2()
This test has the same input as the last, except somebody mixed up the PRIORITY values.
testOpaque()
Testing TRANSP:OPAQUE.
testVAvailabilityOfficeHours()
This VAVAILABILITY object has a 9am-5pm AVAILABLE object for office hours.
testObject()
Testing feeding the freebusy generator an object instead of a string.
testFloatingTimeReferenceTimeZone()
testCancelled()
Testing STATUS:CANCELLED.
assertFreeBusyReport($expected, $input, $timeZone=null, $vavailability=null)
This function takes a list of objects (icalendar objects), and turns them into a freebusy report.
testTentative()
Testing STATUS:TENTATIVE.
testOutsideTimeRange2()
Testing an event that falls outside of the report time-range.
testGeneratorBaseObject()
testOutsideTimeRange()
Testing an event that falls outside of the report time-range.
testVFreeBusy()
Testing feeding VFREEBUSY objects instead of VEVENT.
testVAvailabilityIrrelevant()
This VAVAILABILITY object does not overlap at all with the freebusy report, so it should be ignored.
testDuration()
Testing an event that uses DURATION.
testTransparent()
Testing TRANSP:TRANSPARENT.
testAllDayReferenceTimeZone()
testYearlyRecurrenceDuration()
testAllDay()
Testing an all-day event.
testVAvailabilityOfficeHoursVacation()
This test has the same office hours, but has a vacation blocked off for the relevant time,...
testNoDuration()
Testing an event that has no end or duration.
testInvalidArg()
@expectedException InvalidArgumentException
This class helps with generating FREEBUSY reports based on existing sets of objects.
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
foreach($paths as $path) if($argc< 3) $input