26 $vtodo =
$calendar->createComponent(
'VTODO');
27 $vtodo->DTSTART =
'20111223T120000Z';
28 $tests[] = [$vtodo, new \DateTime(
'2011-01-01'), new \DateTime(
'2012-01-01'),
true];
29 $tests[] = [$vtodo, new \DateTime(
'2011-01-01'), new \DateTime(
'2011-11-01'),
false];
31 $vtodo2 = clone $vtodo;
32 $vtodo2->DURATION =
'P1D';
33 $tests[] = [$vtodo2, new \DateTime(
'2011-01-01'), new \DateTime(
'2012-01-01'),
true];
34 $tests[] = [$vtodo2, new \DateTime(
'2011-01-01'), new \DateTime(
'2011-11-01'),
false];
36 $vtodo3 = clone $vtodo;
37 $vtodo3->DUE =
'20111225';
38 $tests[] = [$vtodo3, new \DateTime(
'2011-01-01'), new \DateTime(
'2012-01-01'),
true];
39 $tests[] = [$vtodo3, new \DateTime(
'2011-01-01'), new \DateTime(
'2011-11-01'),
false];
41 $vtodo4 =
$calendar->createComponent(
'VTODO');
42 $vtodo4->DUE =
'20111225';
43 $tests[] = [$vtodo4, new \DateTime(
'2011-01-01'), new \DateTime(
'2012-01-01'),
true];
44 $tests[] = [$vtodo4, new \DateTime(
'2011-01-01'), new \DateTime(
'2011-11-01'),
false];
46 $vtodo5 =
$calendar->createComponent(
'VTODO');
47 $vtodo5->COMPLETED =
'20111225';
48 $tests[] = [$vtodo5, new \DateTime(
'2011-01-01'), new \DateTime(
'2012-01-01'),
true];
49 $tests[] = [$vtodo5, new \DateTime(
'2011-01-01'), new \DateTime(
'2011-11-01'),
false];
51 $vtodo6 =
$calendar->createComponent(
'VTODO');
52 $vtodo6->CREATED =
'20111225';
53 $tests[] = [$vtodo6, new \DateTime(
'2011-01-01'), new \DateTime(
'2012-01-01'),
true];
54 $tests[] = [$vtodo6, new \DateTime(
'2011-01-01'), new \DateTime(
'2011-11-01'),
false];
56 $vtodo7 =
$calendar->createComponent(
'VTODO');
57 $vtodo7->CREATED =
'20111225';
58 $vtodo7->COMPLETED =
'20111226';
59 $tests[] = [$vtodo7, new \DateTime(
'2011-01-01'), new \DateTime(
'2012-01-01'),
true];
60 $tests[] = [$vtodo7, new \DateTime(
'2011-01-01'), new \DateTime(
'2011-11-01'),
false];
62 $vtodo7 =
$calendar->createComponent(
'VTODO');
63 $tests[] = [$vtodo7, new \DateTime(
'2011-01-01'), new \DateTime(
'2012-01-01'),
true];
64 $tests[] = [$vtodo7, new \DateTime(
'2011-01-01'), new \DateTime(
'2011-11-01'),
true];
78 DTSTAMP:20140402T183400Z
114 $this->assertEquals([
115 "UID MUST appear exactly once in a VTODO component",
116 "DTSTAMP MUST appear exactly once in a VTODO component",
129 DTSTART;VALUE=DATE-TIME:20140520T131600Z
130 DUE;VALUE=DATE:20140520
131 DTSTAMP;VALUE=DATE-TIME:20140520T131600Z
144 $this->assertEquals([
145 "The value type (DATE or DATE-TIME) must be identical for DUE and DTSTART",
158 DTSTART;VALUE=DATE:20140520
159 DUE;VALUE=DATE:20140518
160 DTSTAMP;VALUE=DATE-TIME:20140520T131600Z
173 $this->assertEquals([
174 "DUE must occur after DTSTART",
isInTimeRange(DateTimeInterface $start, DateTimeInterface $end)
Returns true or false depending on if the event falls in the specified time-range.
testValidateDUEDTSTARTMisMatch()
testValidateDUEbeforeDTSTART()
testInTimeRange(VTodo $vtodo, $start, $end, $outcome)
timeRangeTestData
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.