Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function testConditionalTextInitialized(): void |
||
17 | { |
||
18 | $spreadsheet = new Spreadsheet(); |
||
19 | $sheet = $spreadsheet->getActiveSheet(); |
||
20 | |||
21 | $cellRange = 'C3:E5'; |
||
22 | $style = new Style(); |
||
23 | $style->applyFromArray([ |
||
24 | 'fill' => [ |
||
25 | 'color' => ['argb' => 'FFFFC000'], |
||
26 | 'fillType' => Fill::FILL_SOLID, |
||
27 | ], |
||
28 | ]); |
||
29 | |||
30 | $condition = new Conditional(); |
||
31 | $condition->setConditionType(Conditional::CONDITION_CONTAINSTEXT); |
||
32 | $condition->setOperatorType(Conditional::OPERATOR_CONTAINSTEXT); |
||
33 | $condition->setStyle($style); |
||
34 | $sheet->setConditionalStyles($cellRange, [$condition]); |
||
35 | |||
36 | $writer = new XlsxWriter($spreadsheet); |
||
37 | |||
38 | $writerWorksheet = new XlsxWriter\Worksheet($writer); |
||
39 | $data = $writerWorksheet->writeWorksheet($sheet, []); |
||
40 | self::assertStringContainsString('<conditionalFormatting sqref="C3:E5">', $data); |
||
41 | } |
||
43 |