/** * Add a cell * * @param int $width * @param mixed $style * @return \PhpOffice\PhpWord\Element\Cell */ public function addCell($width = null, $style = null) { $cell = new Cell($width, $style); $cell->setDocPart($this->getDocPart(), $this->getDocPartId()); $cell->setPhpWord($this->phpWord); $cell->setNestedLevel($this->getNestedLevel()); $this->cells[] = $cell; return $cell; }
/** * Add preserve text exception * * @expectedException \BadMethodCallException */ public function testAddPreserveTextException() { $oCell = new Cell(); $oCell->setDocPart('Section', 1); $oCell->addPreserveText('text'); }
/** * Add preserve text exception * * @expectedException \BadMethodCallException */ public function testAddPreserveTextException() { $oCell = new Cell(); $oCell->setDocPart('Section', 1); $oCell->addPreserveText(htmlspecialchars('text', ENT_COMPAT, 'UTF-8')); }