summaryrefslogtreecommitdiff
path: root/includes/composer/vendor/om/icalparser/tests/event.dates.phpt
blob: 6af95aec20c6d1c1d48c60e53127b7c63c46858e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/**
 * Copyright (c) 2004-2022 Roman Ožana (https://ozana.cz)
 *
 * @license BSD-3-Clause
 * @author Roman Ožana <roman@ozana.cz>
 */

use om\IcalParser;
use Tester\Assert;
use function tests\test;

require_once __DIR__ . '/bootstrap.php';

test('Events with wrong dates', function () {
	$cal = new IcalParser();
	$cal->parseFile(__DIR__ . '/cal/wrong_dates.ics');
	$events = $cal->getEvents()->sorted();
	Assert::same('29.9.2014 00:00:00', $events[1]['DTSTART']->format('j.n.Y H:i:s'));
	Assert::same(null, $events[1]['DTEND']);

	Assert::same(null, $events[0]['DTSTART']);
	Assert::same('30.9.2014 00:00:00', $events[0]['DTEND']->format('j.n.Y H:i:s'));
});