adds another iMIP REQUEST test
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 23 Jan 2017 15:09:46 +0000 (16:09 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Sat, 6 May 2017 12:10:05 +0000 (14:10 +0200)
Change-Id: I6b36b4b61dfb6e9a6cbe505a617f4cf9136d4d22
Reviewed-on: http://gerrit.tine20.com/customers/4124
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Calendar/Frontend/files/invitation_request_external_mozilla.ics [new file with mode: 0644]
tests/tine20/Calendar/Frontend/iMIPTest.php

diff --git a/tests/tine20/Calendar/Frontend/files/invitation_request_external_mozilla.ics b/tests/tine20/Calendar/Frontend/files/invitation_request_external_mozilla.ics
new file mode 100644 (file)
index 0000000..feb916b
--- /dev/null
@@ -0,0 +1,36 @@
+BEGIN:VCALENDAR
+PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
+VERSION:2.0
+METHOD:REQUEST
+BEGIN:VTIMEZONE
+TZID:Europe/Berlin
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+TZNAME:CEST
+DTSTART:19700329T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+TZNAME:CET
+DTSTART:19701025T030000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+CREATED:20160927T075415Z
+LAST-MODIFIED:20160927T075851Z
+DTSTAMP:20160927T075851Z
+UID:29d7bd4a-0432-ee4c-a549-de01a7b53591
+SUMMARY:Input Plakat für Veranstaltung am 19.10.
+ORGANIZER;CN=Lars;RSVP=TRUE;PARTSTAT=ACCEPTED;ROLE=CHAIR:mailto:l.kneschke@caldav.org
+ATTENDEE;CN="Admin Account, Tine 2.0";CUTYPE=INDIVIDUAL;EMAIL="unittest@
+ tine20.org";PARTSTAT=NEEDS-ACTION:mailto:unittest@tine20.org
+DTSTART;TZID=Europe/Berlin:20160927T113000
+DTEND;TZID=Europe/Berlin:20160927T120000
+TRANSP:OPAQUE
+LOCATION:Büro Philipp
+END:VEVENT
+END:VCALENDAR
index b973777..ac18a36 100644 (file)
@@ -96,26 +96,39 @@ class Calendar_Frontend_iMIPTest extends TestCase
      */
     public function testExternalInvitationRequestAutoProcess()
     {
-        $ics = Calendar_Frontend_WebDAV_EventTest::getVCalendar(dirname(__FILE__) . '/files/invitation_request_external.ics' );
+        return $this->_testExternalImap('invitation_request_external.ics', 5, 'test mit extern');
+    }
+
+    protected function _testExternalImap($icsFilename, $numAttendee, $summary)
+    {
+        $ics = Calendar_Frontend_WebDAV_EventTest::getVCalendar(dirname(__FILE__) . '/files/' . $icsFilename);
         $iMIP = new Calendar_Model_iMIP(array(
             'id'             => Tinebase_Record_Abstract::generateUID(),
             'ics'            => $ics,
             'method'         => 'REQUEST',
             'originator'     => 'l.kneschke@caldav.org',
         ));
-        
+
         $this->_iMIPFrontend->autoProcess($iMIP);
         $prepared = $this->_iMIPFrontend->prepareComponent($iMIP);
-        
+
         $this->assertEmpty($prepared->existing_event, 'there should be no existing event');
         $this->assertEmpty($prepared->preconditions, 'no preconditions should be raised');
-        $this->assertEquals(5, count($prepared->event->attendee));
-        $this->assertEquals('test mit extern', $prepared->event->summary);
-        
+        $this->assertEquals($numAttendee, count($prepared->event->attendee));
+        $this->assertEquals($summary, $prepared->event->summary);
+
         return $iMIP;
     }
 
     /**
+     * testExternalInvitationRequestAutoProcessMozilla
+     */
+    public function testExternalInvitationRequestAutoProcessMozilla()
+    {
+        $this->_testExternalImap('invitation_request_external_mozilla.ics', 2, 'Input Plakat für Veranstaltung am 19.10.');
+    }
+
+    /**
      * testSearchSharedCalendarsForExternalEvents
      *
      * @see 0011024: don't show external imip events in shared calendars