コード例 #1
0
 public function testNormalSendEventNotificationsShouldHaveNoExtensionElements()
 {
     $this->sendEventNotifications->value = true;
     $this->assertEquals($this->sendEventNotifications->value, true);
     $this->assertEquals(count($this->sendEventNotifications->extensionElements), 0);
     $newSendEventNotifications = new Extension\SendEventNotifications();
     $newSendEventNotifications->transferFromXML($this->sendEventNotifications->saveXML());
     $this->assertEquals(count($newSendEventNotifications->extensionElements), 0);
     $newSendEventNotifications->extensionElements = array(new \ZendGData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(count($newSendEventNotifications->extensionElements), 1);
     $this->assertEquals($newSendEventNotifications->value, true);
     /* try constructing using magic factory */
     $cal = new \ZendGData\Calendar();
     $newSendEventNotifications2 = $cal->newSendEventNotifications();
     $newSendEventNotifications2->transferFromXML($newSendEventNotifications->saveXML());
     $this->assertEquals(count($newSendEventNotifications2->extensionElements), 1);
     $this->assertEquals($newSendEventNotifications2->value, true);
 }