diff --git a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/PR3946Test.php b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/PR3946Test.php new file mode 100644 index 000000000..7230ea9c5 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/PR3946Test.php @@ -0,0 +1,42 @@ +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); + } +}