public function testConvertEventEntryToAndFromString()
 {
     $this->entry->transferFromXML($this->entryText);
     $entryXml = $this->entry->saveXML();
     $newEventEntry = new Zend_Gdata_Calendar_EventEntry();
     $newEventEntry->transferFromXML($entryXml);
     $newEventEntryXml = $newEventEntry->saveXML();
     $this->assertEquals($entryXml, $newEventEntryXml);
     $this->assertEquals('http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z', $newEventEntry->id->text);
     $this->assertEquals('Mantek', $newEventEntry->extendedProperty[0]->value);
     $this->assertEquals('s0dtsvq4pe15ku09jideg67fv4', $newEventEntry->originalEvent->id);
     $this->assertEquals('s0dtsvq4pe15ku09jideg67fv4', $newEventEntry->originalEvent->id);
     $this->assertEquals('http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z/comments', $newEventEntry->comments->feedLink->href);
 }
Beispiel #2
0
 /** Add extended property to event
  * @access public
  * @param $event
  * @param array $properties
  * @return Zend_Gdata_Calendar_EventEntry
  */
 public function addExtendedProperty(Zend_Gdata_Calendar_EventEntry $event, $properties)
 {
     if (is_array($properties)) {
         $extendedProperty = array();
         //For each array component add the extended property
         foreach ($properties as $key => $value) {
             $extendedProperty[] = $this->getCalendar()->newExtendedProperty($key, $value);
         }
         $extendedProperties = array_merge($event->extendedProperty, $extendedProperty);
         $event->extendedProperty = $extendedProperties;
         //Save the event and rewrite it on the calendar
         $eventNew = $event->save();
         return $eventNew;
     } else {
         throw new Pas_Calendar_Exception('The properties offered for extension are not an array', 500);
     }
 }