added tests dir
updated logic in gcal-import.php
This commit is contained in:
parent
121af7ba1f
commit
1897df888a
16
tests/test-icalparser.php
Normal file
16
tests/test-icalparser.php
Normal 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>";
|
||||
|
||||
?>
|
||||
|
||||
|
Reference in a new issue