コード例 #1
0
 public function testNormalOpenSearchStartIndexShouldHaveNoExtensionElements()
 {
     $this->openSearchStartIndex->text = "20";
     $this->assertEquals("20", $this->openSearchStartIndex->text);
     $this->assertEquals(0, count($this->openSearchStartIndex->extensionElements));
     $newOpenSearchStartIndex = new Zend_Gdata_Extension_OpenSearchStartIndex();
     $newOpenSearchStartIndex->transferFromXML($this->openSearchStartIndex->saveXML());
     $this->assertEquals(0, count($newOpenSearchStartIndex->extensionElements));
     $newOpenSearchStartIndex->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newOpenSearchStartIndex->extensionElements));
     $this->assertEquals("20", $newOpenSearchStartIndex->text);
     /* try constructing using magic factory */
     $gdata = new Zend_Gdata();
     $newOpenSearchStartIndex2 = $gdata->newOpenSearchStartIndex();
     $newOpenSearchStartIndex2->transferFromXML($newOpenSearchStartIndex->saveXML());
     $this->assertEquals(1, count($newOpenSearchStartIndex2->extensionElements));
     $this->assertEquals("20", $newOpenSearchStartIndex2->text);
 }