0010086: creating recur series loses displaycontainer_id
authorsstamer <s.stamer@metaways.de>
Wed, 8 Apr 2015 13:19:28 +0000 (15:19 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 8 Jul 2015 08:29:24 +0000 (10:29 +0200)
Events don't show up in attendees personal calendar

- test

https://forge.tine20.org/view.php?id=10086

Change-Id: I9185e375cbbf2b9f519b045e7f93fa345bef8684
Reviewed-on: http://gerrit.tine20.com/customers/1801
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Calendar/Controller/RecurTest.php

index 0d79cf5..0c2c86c 100644 (file)
@@ -693,6 +693,36 @@ class Calendar_Controller_RecurTest extends Calendar_TestCase
     }
     
     /**
+     * Events don't show up in attendees personal calendar
+     */
+    public function testCreateRecurExceptionAllFollowingAttendeeAdd2()
+    {
+        $from = new Tinebase_DateTime('2014-04-01 00:00:00');
+        $until = new Tinebase_DateTime('2014-04-29 23:59:59');
+        
+        $persistentEvent = $this->_getDailyEvent(new Tinebase_DateTime('2014-04-03 09:00:00'));
+        
+        $exceptions = new Tinebase_Record_RecordSet('Calendar_Model_Event');
+        $recurSet = Calendar_Model_Rrule::computeRecurrenceSet($persistentEvent, $exceptions, $from, $until);
+        
+        $recurSet[5]->attendee->addRecord(new Calendar_Model_Attender(array(
+                'user_type'   => Calendar_Model_Attender::USERTYPE_USER,
+                'user_id'     => $this->_getPersonasContacts('pwulf')->getId()
+        )));
+        
+        $updatedPersistentEvent = $this->_controller->createRecurException($recurSet[5], FALSE, TRUE);
+        $this->assertEquals(3, count($updatedPersistentEvent->attendee));
+        
+        $filter = new Calendar_Model_EventFilter(array(
+                array('field' => 'container_id',             'operator' => 'equals', 'value' => $this->_personasDefaultCals['pwulf']->id),
+                array('field' => 'attender_status', 'operator' => 'not',    'value' => Calendar_Model_Attender::STATUS_DECLINED),
+        ));
+        
+        $events = $this->_controller->search($filter);
+        $this->assertEquals(1, count($events), 'event should be found, but is not');
+    }
+    
+    /**
      * create daily recur series
      * 
      * @param Tinebase_DateTime $dtstart