Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * Add preserve text exception
  *
  * @expectedException \BadMethodCallException
  */
 public function testAddPreserveTextException()
 {
     $oCell = new Cell();
     $oCell->setDocPart('Section', 1);
     $oCell->addPreserveText('text');
 }
Beispiel #3
0
 /**
  * Add preserve text exception
  *
  * @expectedException \BadMethodCallException
  */
 public function testAddPreserveTextException()
 {
     $oCell = new Cell();
     $oCell->setDocPart('Section', 1);
     $oCell->addPreserveText(htmlspecialchars('text', ENT_COMPAT, 'UTF-8'));
 }