public function testToAndFromString() { $this->rowCount->setText('20'); $this->assertTrue($this->rowCount->getText() == '20'); $newRowCount = new Extension\RowCount(); $doc = new \DOMDocument(); $doc->loadXML($this->rowCount->saveXML()); $newRowCount->transferFromDom($doc->documentElement); $this->assertTrue($this->rowCount->getText() == $newRowCount->getText()); }
public function testGetSetCounts() { $newRowCount = new Extension\RowCount(); $newRowCount->setText("20"); $newColCount = new Extension\ColCount(); $newColCount->setText("50"); $this->cellFeed->setRowCount($newRowCount); $this->cellFeed->setColumnCount($newColCount); $this->assertTrue($this->cellFeed->getRowCount()->getText() == "20"); $this->assertTrue($this->cellFeed->getColumnCount()->getText() == "50"); }
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) { $element = parent::getDOM($doc, $majorVersion, $minorVersion); if ($this->rowCount != null) { $element->appendChild($this->_rowCount->getDOM($element->ownerDocument)); } if ($this->colCount != null) { $element->appendChild($this->_colCount->getDOM($element->ownerDocument)); } return $element; }
/** * Creates individual Entry objects of the appropriate type and * stores them in the $_entry array based upon DOM data. * * @param DOMNode $child The DOMNode to process */ protected function takeChildFromDOM($child) { $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; switch ($absoluteNodeName) { case $this->lookupNamespace('gs') . ':' . 'rowCount': $rowCount = new Extension\RowCount(); $rowCount->transferFromDOM($child); $this->_rowCount = $rowCount; break; case $this->lookupNamespace('gs') . ':' . 'colCount': $colCount = new Extension\ColCount(); $colCount->transferFromDOM($child); $this->_colCount = $colCount; break; default: parent::takeChildFromDOM($child); break; } }