Example #1
0
 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());
 }
Example #2
0
 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");
 }
Example #3
0
 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;
 }
Example #4
0
 /**
  * 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;
     }
 }