/** * Create new instance with parameters */ public function testConstructWithParams() { $iVal = rand(1, 1000); $oRow = new Row($iVal, array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => '66BBFF')); $this->assertEquals($iVal, $oRow->getHeight()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Row', $oRow->getStyle()); }
/** * Write row. * * @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter * @param \PhpOffice\PhpWord\Element\Row $row * @return void */ private function writeRow(XMLWriter $xmlWriter, RowElement $row) { $xmlWriter->startElement('w:tr'); // Write style $rowStyle = $row->getStyle(); if ($rowStyle instanceof RowStyle) { $styleWriter = new RowStyleWriter($xmlWriter, $rowStyle); $styleWriter->setHeight($row->getHeight()); $styleWriter->write(); } // Write cells foreach ($row->getCells() as $cell) { $this->writeCell($xmlWriter, $cell); } $xmlWriter->endElement(); // w:tr }