Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15426789
D16761.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D16761.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -727,7 +727,7 @@
'PhutilCalendarDateTime' => 'Phobject',
'PhutilCalendarDocumentNode' => 'PhutilCalendarContainerNode',
'PhutilCalendarDuration' => 'Phobject',
- 'PhutilCalendarEventNode' => 'PhutilCalendarNode',
+ 'PhutilCalendarEventNode' => 'PhutilCalendarContainerNode',
'PhutilCalendarNode' => 'Phobject',
'PhutilCalendarProxyDateTime' => 'PhutilCalendarDateTime',
'PhutilCalendarRawNode' => 'PhutilCalendarContainerNode',
diff --git a/src/parser/calendar/data/PhutilCalendarEventNode.php b/src/parser/calendar/data/PhutilCalendarEventNode.php
--- a/src/parser/calendar/data/PhutilCalendarEventNode.php
+++ b/src/parser/calendar/data/PhutilCalendarEventNode.php
@@ -1,7 +1,7 @@
<?php
final class PhutilCalendarEventNode
- extends PhutilCalendarNode {
+ extends PhutilCalendarContainerNode {
const NODETYPE = 'event';
diff --git a/src/parser/calendar/ics/__tests__/PhutilICSParserTestCase.php b/src/parser/calendar/ics/__tests__/PhutilICSParserTestCase.php
--- a/src/parser/calendar/ics/__tests__/PhutilICSParserTestCase.php
+++ b/src/parser/calendar/ics/__tests__/PhutilICSParserTestCase.php
@@ -169,6 +169,20 @@
$end->getEpoch());
}
+ public function testICSVALARM() {
+ $event = $this->parseICSSingleEvent('valarm.ics');
+
+ // For now, we parse but ignore VALARM sections. This test just makes
+ // sure they survive parsing.
+
+ $start_epoch = strtotime('2016-10-19 22:00:00 UTC');
+ $this->assertEqual(1476914400, $start_epoch);
+
+ $this->assertEqual(
+ $start_epoch,
+ $event->getStartDateTime()->getEpoch());
+ }
+
public function testICSDuration() {
$event = $this->parseICSSingleEvent('duration.ics');
@@ -211,7 +225,6 @@
'err-root-property.ics' => PhutilICSParser::PARSE_ROOT_PROPERTY,
'err-unescaped-backslash.ics' =>
PhutilICSParser::PARSE_UNESCAPED_BACKSLASH,
- 'err-unexpected-child.ics' => PhutilICSParser::PARSE_UNEXPECTED_CHILD,
'err-unexpected-text.ics' => PhutilICSParser::PARSE_UNEXPECTED_TEXT,
'err-multiple-parameters.ics' =>
PhutilICSParser::PARSE_MULTIPLE_PARAMETERS,
diff --git a/src/parser/calendar/ics/__tests__/data/err-unexpected-child.ics b/src/parser/calendar/ics/__tests__/data/err-unexpected-child.ics
deleted file mode 100644
--- a/src/parser/calendar/ics/__tests__/data/err-unexpected-child.ics
+++ /dev/null
@@ -1,6 +0,0 @@
-BEGIN:VCALENDAR
-BEGIN:VEVENT
-BEGIN:TEST
-END:TEST
-END:VEVENT
-END:VCALENDAR
diff --git a/src/parser/calendar/ics/__tests__/data/valarm.ics b/src/parser/calendar/ics/__tests__/data/valarm.ics
new file mode 100644
--- /dev/null
+++ b/src/parser/calendar/ics/__tests__/data/valarm.ics
@@ -0,0 +1,16 @@
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+CREATED:20161027T173727
+DTSTAMP:20161027T173727
+LAST-MODIFIED:20161027T173727
+UID:aic4zm86mg
+SUMMARY:alarm event
+DTSTART;TZID=Europe/Berlin:20161020T000000
+DTEND;TZID=Europe/Berlin:20161020T010000
+BEGIN:VALARM
+ACTION:AUDIO
+TRIGGER:-PT15M
+END:VALARM
+END:VEVENT
+END:VCALENDAR
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 24, 10:51 AM (3 d, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223909
Default Alt Text
D16761.diff (3 KB)
Attached To
Mode
D16761: Parse (and discard) VALARM sections in ICS files
Attached
Detach File
Event Timeline
Log In to Comment