Esempio n. 1
0
 public function testToAndFromString()
 {
     $this->itemEntry->setItemType('products');
     $this->assertEquals($this->itemEntry->getItemType()->getText(), 'products');
     $this->itemEntry->addGBaseAttribute('price', '10.99 USD', 'floatUnit');
     $baseAttribute = $this->itemEntry->getGBaseAttribute('price');
     $this->assertEquals(count($baseAttribute), 1);
     $this->assertEquals($baseAttribute[0]->getName(), 'price');
     $this->assertEquals($baseAttribute[0]->getText(), '10.99 USD');
     $this->assertEquals($baseAttribute[0]->getType(), 'floatUnit');
     $newItemEntry = new GBase\ItemEntry();
     $doc = new \DOMDocument();
     $doc->loadXML($this->itemEntry->saveXML());
     $newItemEntry->transferFromDom($doc->documentElement);
     $rowDataFromXML = $newItemEntry->getGBaseAttribute('price');
     $this->assertEquals($this->itemEntry->getItemType()->getText(), $newItemEntry->getItemType()->getText());
     $this->assertEquals(count($rowDataFromXML), 1);
     $this->assertEquals($rowDataFromXML[0]->getName(), 'price');
     $this->assertEquals($rowDataFromXML[0]->getText(), '10.99 USD');
     $this->assertEquals($rowDataFromXML[0]->getType(), 'floatUnit');
 }
Esempio n. 2
0
 /**
  * Delete an entry
  *
  * @param \Zend\GData\GBase\ItemEntry $entry The Base entry to remove
  * @param boolean $dryRun Flag for the 'dry-run' parameter
  * @return \Zend\GData\GBase\ItemFeed
  */
 public function deleteGBaseItem($entry, $dryRun = false)
 {
     $entry->delete($dryRun);
     return $this;
 }