getActiveSheet(); $cellRange = 'C3:E5'; $style = new Style(); $style->applyFromArray([ 'fill' => [ 'color' => ['argb' => 'FFFFC000'], 'fillType' => Fill::FILL_SOLID, ], ]); $condition = new Conditional(); $condition->setConditionType(Conditional::CONDITION_CONTAINSTEXT); $condition->setOperatorType(Conditional::OPERATOR_CONTAINSTEXT); $condition->setStyle($style); $sheet->setConditionalStyles($cellRange, [$condition]); $writer = new XlsxWriter($spreadsheet); $writerWorksheet = new XlsxWriter\Worksheet($writer); $data = $writerWorksheet->writeWorksheet($sheet, []); self::assertStringContainsString('', $data); } }