[Pkg-owncloud-commits] [php-sabre-vobject] 01/07: incorrect work with timezone without event master
David Prévot
taffit at moszumanska.debian.org
Wed Apr 27 18:03:05 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch 3
in repository php-sabre-vobject.
commit 98e850849e35b6526f4621f9a228dd691c2d7d16
Author: Visily Komrakov <vkomrakov at sugarcrm.com>
Date: Fri Apr 1 13:30:28 2016 +0300
incorrect work with timezone without event master
---
lib/ITip/Broker.php | 2 +-
...erTimezoneInParseEventInfoWithoutMasterTest.php | 77 ++++++++++++++++++++++
2 files changed, 78 insertions(+), 1 deletion(-)
diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index e439196..08a7a98 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -826,7 +826,7 @@ class Broker {
$organizerName = null;
$organizerForceSend = null;
$sequence = null;
- $timezone = null;
+ $timezone = $calendar->VTIMEZONE ? $calendar->VTIMEZONE->getTimeZone() : null;
$status = null;
$organizerScheduleAgent = 'SERVER';
diff --git a/tests/VObject/ITip/BrokerTimezoneInParseEventInfoWithoutMasterTest.php b/tests/VObject/ITip/BrokerTimezoneInParseEventInfoWithoutMasterTest.php
new file mode 100644
index 0000000..fadebff
--- /dev/null
+++ b/tests/VObject/ITip/BrokerTimezoneInParseEventInfoWithoutMasterTest.php
@@ -0,0 +1,77 @@
+<?php
+
+namespace Sabre\VObject\ITip;
+
+use Sabre\VObject\Reader;
+
+class BrokerTimezoneInParseEventInfoWithoutMasterTest extends \PHPUnit_Framework_TestCase {
+
+ function testTimezoneInParseEventInfoWithoutMaster()
+ {
+ $calendar = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//Apple Inc.//Mac OS X 10.9.5//EN
+CALSCALE:GREGORIAN
+BEGIN:VTIMEZONE
+TZID:Europe/Minsk
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0200
+RRULE:FREQ=YEARLY;UNTIL=20100328T000000Z;BYMONTH=3;BYDAY=-1SU
+DTSTART:19930328T020000
+TZNAME:GMT+3
+TZOFFSETTO:+0300
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+DTSTART:20110327T020000
+TZNAME:GMT+3
+TZOFFSETTO:+0300
+RDATE:20110327T020000
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+CREATED:20160331T163031Z
+UID:B9301437-417C-4136-8DB3-8D1555863791
+DTEND;TZID=Europe/Minsk:20160405T100000
+TRANSP:OPAQUE
+ATTENDEE;CN=User Invitee;CUTYPE=INDIVIDUAL;EMAIL=invitee at test.com;PARTSTAT=
+ ACCEPTED;ROLE=REQ-PARTICIPANT:mailto:invitee at test.com
+ATTENDEE;CN=User Organizer;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:mailto:organ
+ izer at test.com
+SUMMARY:Event title
+DTSTART;TZID=Europe/Minsk:20160405T090000
+DTSTAMP:20160331T164108Z
+ORGANIZER;CN=User Organizer:mailto:organizer at test.com
+SEQUENCE:6
+RECURRENCE-ID;TZID=Europe/Minsk:20160405T090000
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20160331T163031Z
+UID:B9301437-417C-4136-8DB3-8D1555863791
+DTEND;TZID=Europe/Minsk:20160406T100000
+TRANSP:OPAQUE
+ATTENDEE;CN=User Invitee;CUTYPE=INDIVIDUAL;EMAIL=invitee at test.com;PARTSTAT=
+ ACCEPTED;ROLE=REQ-PARTICIPANT:mailto:invitee at test.com
+ATTENDEE;CN=User Organizer;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:mailto:organ
+ izer at test.com
+SUMMARY:Event title
+DTSTART;TZID=Europe/Minsk:20160406T090000
+DTSTAMP:20160331T165845Z
+ORGANIZER;CN=User Organizer:mailto:organizer at test.com
+SEQUENCE:6
+RECURRENCE-ID;TZID=Europe/Minsk:20160406T090000
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+ $calendar = Reader::read($calendar);
+ $broker = new Broker();
+
+ $reflectionMethod = new \ReflectionMethod($broker, 'parseEventInfo');
+ $reflectionMethod->setAccessible(true);
+ $data = $reflectionMethod->invoke($broker, $calendar);
+
+ $this->assertEquals($data['timezone']->getName(), 'Europe/Minsk');
+ }
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-php/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list