protected function takeChildFromDOM($child) { $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; switch ($absoluteNodeName) { case $this->lookupNamespace('gs') . ':' . 'cell': $cell = new Extension\Cell(); $cell->transferFromDOM($child); $this->_cell = $cell; break; default: parent::takeChildFromDOM($child); break; } }
public function testToAndFromString() { $this->cell->setText('test cell'); $this->assertTrue($this->cell->getText() == 'test cell'); $this->cell->setRow('1'); $this->assertTrue($this->cell->getRow() == '1'); $this->cell->setColumn('2'); $this->assertTrue($this->cell->getColumn() == '2'); $this->cell->setInputValue('test input value'); $this->assertTrue($this->cell->getInputValue() == 'test input value'); $this->cell->setNumericValue('test numeric value'); $this->assertTrue($this->cell->getNumericValue() == 'test numeric value'); $newCell = new Extension\Cell(); $doc = new \DOMDocument(); $doc->loadXML($this->cell->saveXML()); $newCell->transferFromDom($doc->documentElement); $this->assertTrue($this->cell->getText() == $newCell->getText()); $this->assertTrue($this->cell->getRow() == $newCell->getRow()); $this->assertTrue($this->cell->getColumn() == $newCell->getColumn()); $this->assertTrue($this->cell->getInputValue() == $newCell->getInputValue()); $this->assertTrue($this->cell->getNumericValue() == $newCell->getNumericValue()); }