7use PHPUnit\Framework\TestCase;
27 $this->assertInstanceOf(__NAMESPACE__ .
'\VAvailability', $document->VAVAILABILITY);
36DTSTART:20150717T162200Z
43 $tz =
new DateTimeZone(
'UTC');
46 new DateTimeImmutable(
'2015-07-17 16:22:00',
$tz),
47 new DateTimeImmutable(
'2015-07-17 17:22:00',
$tz),
49 $document->VAVAILABILITY->getEffectiveStartEnd()
59DTSTART:20150717T162200Z
66 $tz =
new DateTimeZone(
'UTC');
69 new DateTimeImmutable(
'2015-07-17 16:22:00',
$tz),
70 new DateTimeImmutable(
'2015-07-17 17:22:00',
$tz),
72 $document->VAVAILABILITY->getEffectiveStartEnd()
92 $document->VAVAILABILITY->getEffectiveStartEnd()
108 $document->VAVAILABILITY->isInTimeRange(
new DateTimeImmutable(
'2015-07-17'),
new DateTimeImmutable(
'2015-07-18'))
118DTSTART:20140101T000000Z
119DTEND:20140102T000000Z
126 $document->VAVAILABILITY->isInTimeRange(
new DateTimeImmutable(
'2015-07-17'),
new DateTimeImmutable(
'2015-07-18'))
141DTSTAMP:20111005T133225Z
179DTSTAMP:20111005T133225Z
192 'CREATED:20111005T135125Z',
193 'DESCRIPTION:Long bla bla',
194 'DTSTART:20111005T020000',
195 'LAST-MODIFIED:20111005T135325Z',
196 'ORGANIZER:mailto:foo@example.com',
200 'URL:http://example.org/'
207 foreach ($properties as $property) {
220 'DTEND:21111005T133225Z'
230 'DTEND:21111005T133225Z',
247 $this->assertInstanceOf(__NAMESPACE__, $document->VAVAILABILITY->AVAILABLE);
261DTSTAMP:20111005T133225Z
264DTSTAMP:20111005T133225Z
265DTSTART:20111005T133225Z
280DTSTAMP:20111005T133225Z
296DTSTAMP:20111005T133225Z
298DTSTAMP:20111005T133225Z
299DTSTART:20111005T133225Z
314DTSTAMP:20111005T133225Z
317DTSTART:20111005T133225Z
332DTSTAMP:20111005T133225Z
335DTSTAMP:20111005T133225Z
348 'DTEND:21111005T133225Z'
358 'DTEND:21111005T133225Z',
366 'CREATED:20111005T135125Z',
367 'DESCRIPTION:Long bla bla',
368 'LAST-MODIFIED:20111005T135325Z',
369 'RECURRENCE-ID;RANGE=THISANDFUTURE:19980401T133000Z',
370 'RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR',
378 foreach ($properties as $property) {
402 'BUSYTYPE:BUSY-UNAVAILABLE'
413 'BUSYTYPE:BUSY-TENTATIVE'
425 $validationResult = $document->validate();
426 if ($validationResult) {
427 $messages = array_map(
function($item) {
return $item[
'message']; }, $validationResult);
428 $this->fail(
'Failed to assert that the supplied document is a valid document. Validation messages: ' . implode(
', ',
$messages));
430 $this->assertEmpty($document->validate());
436 $this->assertNotEmpty($document->validate());
440 protected function template(array $properties) {
449DTSTAMP:20111005T133225Z
469DTSTAMP:20111005T133225Z
472DTSTAMP:20111005T133225Z
473DTSTART:20111005T133225Z
487 return str_replace(
'…', implode(
"\r\n", $properties),
$template);
An exception for terminatinating execution or to throw for unit testing.
We use RFCxxx has a placeholder for the https://tools.ietf.org/html/draft-daboo-calendar-availability...
testAvailableSubComponent()
testGetEffectiveStartEnd()
assertIsNotValid(VObject\Document $document)
testRFCxxxSection3_1_available_dtend_duration()
templateAvailable(array $properties)
testVAvailabilityComponent()
_template($template, array $properties)
testGetEffectiveStartEndUnbound()
testIsInTimeRangeOutside()
testIsInTimeRangeUnbound()
testRFCxxxSection3_1_availabilityprop_required()
testRFCxxxSection3_1_available_optional_once()
testRFCxxxSection3_1_availableprop_required()
assertIsValid(VObject\Document $document)
testRFCxxxSection3_1_availabilityprop_optional_once()
testRFCxxxSection3_1_availabilityprop_dtend_duration()
testGetEffectiveStartDuration()
iCalendar/vCard/jCal/jCard/xCal/xCard reader object.
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.