Beispiel #1
0
 public function testNormalAccessLevelShouldHaveNoExtensionElements()
 {
     $this->accessLevel->value = 'freebusy';
     $this->assertEquals($this->accessLevel->value, 'freebusy');
     $this->assertEquals(count($this->accessLevel->extensionElements), 0);
     $newAccessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
     $newAccessLevel->transferFromXML($this->accessLevel->saveXML());
     $this->assertEquals(count($newAccessLevel->extensionElements), 0);
     $newAccessLevel->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(count($newAccessLevel->extensionElements), 1);
     $this->assertEquals($newAccessLevel->value, 'freebusy');
     /* try constructing using magic factory */
     $cal = new Zend_Gdata_Calendar();
     $newAccessLevel2 = $cal->newAccessLevel();
     $newAccessLevel2->transferFromXML($newAccessLevel->saveXML());
     $this->assertEquals(count($newAccessLevel2->extensionElements), 1);
     $this->assertEquals($newAccessLevel2->value, 'freebusy');
 }