Example #1
0
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gCal') . ':' . 'sendEventNotifications':
             $sendEventNotifications = new Extension\SendEventNotifications();
             $sendEventNotifications->transferFromDOM($child);
             $this->_sendEventNotifications = $sendEventNotifications;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'timezone':
             $timezone = new Extension\Timezone();
             $timezone->transferFromDOM($child);
             $this->_timezone = $timezone;
             break;
         case $this->lookupNamespace('atom') . ':' . 'link':
             $link = new Extension\Link();
             $link->transferFromDOM($child);
             $this->_link[] = $link;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'quickadd':
             $quickadd = new Extension\QuickAdd();
             $quickadd->transferFromDOM($child);
             $this->_quickadd = $quickadd;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->sendEventNotifications->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->sendEventNotifications->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->sendEventNotifications->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->sendEventNotifications->extensionAttributes['foo2']['value']);
     $sendEventNotificationsXml = $this->sendEventNotifications->saveXML();
     $newSendEventNotifications = new Extension\SendEventNotifications();
     $newSendEventNotifications->transferFromXML($sendEventNotificationsXml);
     $this->assertEquals('bar', $newSendEventNotifications->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newSendEventNotifications->extensionAttributes['foo2']['value']);
 }