public function testBuild() { $cellBuilder = new CellBuilder(); $expectedXml = '<c r="D1" s="0" t="inlineStr"><is><t>Something</t></is></c>'; $this->assertEquals($expectedXml, $cellBuilder->build(1, 3, 'Something')); $expectedXml = '<c r="D1" s="0" t="inlineStr"><is><t>_x0003_</t></is></c>'; $this->assertEquals($expectedXml, $cellBuilder->build(1, 3, chr(3))); }
/** * Build and return xml string for single cell and update cell widths. * * @param array $row * @param Style $style * @return string */ private function getCellXml(array $row, Style $style) { $cellXml = ''; foreach (array_values($row) as $cellIndex => $cellValue) { $this->updateColumnWidths($cellValue, $cellIndex, $style); $cellXml .= $this->cellBuilder->build($this->rowIndex, $cellIndex, $cellValue, $style->getId()); } return $cellXml; }