public function testNormalCategoryShouldHaveNoExtensionElements() { $this->category->scheme = 'http://schemas.google.com/g/2005#kind'; $this->assertEquals($this->category->scheme, 'http://schemas.google.com/g/2005#kind'); $this->assertEquals(count($this->category->extensionElements), 0); $newCategory = new Zend_Gdata_App_Extension_Category(); $newCategory->transferFromXML($this->category->saveXML()); $this->assertEquals(0, count($newCategory->extensionElements)); $newCategory->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); $this->assertEquals(count($newCategory->extensionElements), 1); $this->assertEquals($newCategory->scheme, 'http://schemas.google.com/g/2005#kind'); /* try constructing using magic factory */ $app = new Zend_Gdata_App(); $newCategory2 = $app->newCategory(); $newCategory2->transferFromXML($newCategory->saveXML()); $this->assertEquals(count($newCategory2->extensionElements), 1); $this->assertEquals($newCategory2->scheme, 'http://schemas.google.com/g/2005#kind'); }