Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roman Ožana
committed
Nov 6, 2019
1 parent
bde9cb1
commit 5209e74
Showing
3 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
X-WR-CALNAME:URL | ||
CALSCALE:GREGORIAN | ||
BEGIN:VTIMEZONE | ||
TZID:Europe/Berlin | ||
TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Berlin | ||
X-LIC-LOCATION:Europe/Berlin | ||
BEGIN:DAYLIGHT | ||
TZOFFSETFROM:+0100 | ||
TZOFFSETTO:+0200 | ||
TZNAME:CEST | ||
DTSTART:19700329T020000 | ||
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU | ||
END:DAYLIGHT | ||
BEGIN:STANDARD | ||
TZOFFSETFROM:+0200 | ||
TZOFFSETTO:+0100 | ||
TZNAME:CET | ||
DTSTART:19701025T030000 | ||
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU | ||
END:STANDARD | ||
END:VTIMEZONE | ||
BEGIN:VEVENT | ||
DTSTAMP:20191106T093607Z | ||
UID:20191106T093607Z-791992399@marudot.com | ||
DTSTART;VALUE=DATE:20191101 | ||
DTEND;VALUE=DATE:20191102 | ||
SUMMARY:Example event | ||
URL:https%3A%2F%2Fgithub.com%2FOzzyCzech%2Ficalparser%2F | ||
END:VEVENT | ||
END:VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* @author Roman Ozana <ozana@omdesign.cz> | ||
*/ | ||
|
||
use Tester\Assert; | ||
use Tester\Environment; | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
Environment::setup(); | ||
date_default_timezone_set('Europe/Prague'); | ||
|
||
// sort by date | ||
$cal = new \om\IcalParser(); | ||
$results = $cal->parseFile(__DIR__ . '/cal/url.ics'); | ||
|
||
Assert::true(isset($results['VEVENT'][0])); | ||
$event = reset($results['VEVENT']); | ||
Assert::true(isset($event['URL'])); | ||
Assert::equal($event['URL'], urlencode('https://github.com/OzzyCzech/icalparser/')); |