public function testToAndFromString() { $this->colCount->setText('20'); $this->assertTrue($this->colCount->getText() == '20'); $newColCount = new Extension\ColCount(); $doc = new \DOMDocument(); $doc->loadXML($this->colCount->saveXML()); $newColCount->transferFromDom($doc->documentElement); $this->assertTrue($this->colCount->getText() == $newColCount->getText()); }
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; }
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"); }
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; } }