summaryrefslogtreecommitdiff
path: root/includes/composer/vendor/om/icalparser/tests/missing.timezone.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'includes/composer/vendor/om/icalparser/tests/missing.timezone.phpt')
-rw-r--r--includes/composer/vendor/om/icalparser/tests/missing.timezone.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/includes/composer/vendor/om/icalparser/tests/missing.timezone.phpt b/includes/composer/vendor/om/icalparser/tests/missing.timezone.phpt
new file mode 100644
index 0000000..63eb6c2
--- /dev/null
+++ b/includes/composer/vendor/om/icalparser/tests/missing.timezone.phpt
@@ -0,0 +1,24 @@
+<?php
+
+use om\IcalParser;
+use Tester\Assert;
+use function tests\test;
+
+require_once __DIR__ . '/bootstrap.php';
+date_default_timezone_set('Europe/Prague');
+
+test('Time zone should remain empty', function () {
+ $cal = new IcalParser();
+ $cal->parseFile(__DIR__ . '/cal/missing-timezone.ics');
+
+ Assert::null($cal->timezone);
+});
+
+test('Timezone should be same as current timezone', function () {
+ $cal = new IcalParser();
+ $cal->parseFile(__DIR__ . '/cal/missing-timezone.ics');
+ $dtstart = $cal->getEvents()->reversed()->getIterator()->current()['DTSTART'];
+ /** @var DateTime $dtstart */
+ Assert::same('Europe/Prague', $dtstart->getTimezone()->getName());
+ Assert::same('7.11.2022', $dtstart->format('j.n.Y'));
+}); \ No newline at end of file