added tests dir

updated logic in gcal-import.php
This commit is contained in:
Harald Milz 2019-03-24 12:12:08 +01:00
parent 121af7ba1f
commit 1897df888a

16
tests/test-icalparser.php Normal file
View file

@ -0,0 +1,16 @@
<?php
echo "<ul>";
require_once __DIR__ . '/../vendor/autoload.php';
$cal = new \om\IcalParser();
$results = $cal->parseFile(
'https://calendar.google.com/calendar/ical/gruene.freising%40gmail.com/public/basic.ics'
);
foreach ($cal->getSortedEvents() as $r) {
echo sprintf(' <li>%s - %s</li>' . PHP_EOL, $r['DTSTART']->format('j.n.Y'), $r['SUMMARY']);
}
echo "</ul>";
?>