|
@@ 90-101 (lines=12) @@
|
| 87 |
|
]); |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
public function testMultiDayEvent() |
| 91 |
|
{ |
| 92 |
|
$firstDay = Date::fromDateTimeInterface(DateTimeImmutable::createFromFormat('Y-m-d', '2030-12-24')); |
| 93 |
|
$lastDay = Date::fromDateTimeInterface(DateTimeImmutable::createFromFormat('Y-m-d', '2030-12-26')); |
| 94 |
|
$occurrence = MultiDay::fromDates($firstDay, $lastDay); |
| 95 |
|
$event = Event::create()->setOccurrence($occurrence); |
| 96 |
|
|
| 97 |
|
$this->assertEventRendersCorrect($event, [ |
| 98 |
|
'DTSTART:20301224', |
| 99 |
|
'DTEND:20301227', |
| 100 |
|
]); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
public function testTimespanEvent() |
| 104 |
|
{ |
|
@@ 103-114 (lines=12) @@
|
| 100 |
|
]); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
public function testTimespanEvent() |
| 104 |
|
{ |
| 105 |
|
$begin = DateTime::fromDateTimeInterface(DateTimeImmutable::createFromFormat('Y-m-d H:i', '2030-12-24 12:15')); |
| 106 |
|
$end = DateTime::fromDateTimeInterface(DateTimeImmutable::createFromFormat('Y-m-d H:i', '2030-12-24 13:45')); |
| 107 |
|
$occurrence = TimeSpan::create($begin, $end); |
| 108 |
|
$event = Event::create()->setOccurrence($occurrence); |
| 109 |
|
|
| 110 |
|
$this->assertEventRendersCorrect($event, [ |
| 111 |
|
'DTSTART:20301224T121500', |
| 112 |
|
'DTEND:20301224T134500', |
| 113 |
|
]); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
private function assertEventRendersCorrect(Event $event, array $expected) |
| 117 |
|
{ |