Exemplo n.º 1
0
 public function testNormalNicknameShouldHaveNoExtensionElements()
 {
     $this->nickname->name = "Trogdor";
     $this->assertEquals("Trogdor", $this->nickname->name);
     $this->assertEquals(0, count($this->nickname->extensionElements));
     $newNickname = new Zend_Gdata_Gapps_Extension_Nickname();
     $newNickname->transferFromXML($this->nickname->saveXML());
     $this->assertEquals(0, count($newNickname->extensionElements));
     $newNickname->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newNickname->extensionElements));
     $this->assertEquals("Trogdor", $newNickname->name);
     /* try constructing using magic factory */
     $gdata = new Zend_Gdata_Gapps();
     $newNickname2 = $gdata->newNickname();
     $newNickname2->transferFromXML($newNickname->saveXML());
     $this->assertEquals(1, count($newNickname2->extensionElements));
     $this->assertEquals("Trogdor", $newNickname2->name);
 }