public function testToAndFromString() { $this->assertTrue(count($this->listFeed->entries) == 1); foreach ($this->listFeed->entries as $entry) { $this->assertTrue($entry instanceof Spreadsheets\ListEntry); } $newListFeed = new Spreadsheets\ListFeed(); $doc = new \DOMDocument(); $doc->loadXML($this->listFeed->saveXML()); $newListFeed->transferFromDom($doc->documentElement); $this->assertTrue(count($newListFeed->entries) == 1); foreach ($newListFeed->entries as $entry) { $this->assertTrue($entry instanceof Spreadsheets\ListEntry); } }
public function testToAndFromString() { $this->assertEquals(2, count($this->listFeed->entries)); $this->assertEquals(2, $this->listFeed->entries->count()); foreach ($this->listFeed->entries as $entry) { $this->assertInstanceOf('Zend\\GData\\Spreadsheets\\ListEntry', $entry); } $newListFeed = new ListFeed(); $doc = new \DOMDocument(); $doc->loadXML($this->listFeed->saveXML()); $newListFeed->transferFromDom($doc->documentElement); $this->assertEquals(2, count($newListFeed->entries)); $this->assertEquals(2, $newListFeed->entries->count()); foreach ($newListFeed->entries as $entry) { $this->assertInstanceOf('Zend\\GData\\Spreadsheets\\ListEntry', $entry); } }