Passed
Pull Request — master (#4508)
by Owen
11:14
created

StylesWriterTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 11
c 1
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testStylesWriter() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpOffice\PhpSpreadsheetTests\Writer\Xlsx;
6
7
use PhpOffice\PhpSpreadsheet\Spreadsheet;
8
use PhpOffice\PhpSpreadsheet\Writer\Xlsx as XlsxWriter;
9
use PHPUnit\Framework\TestCase;
10
11
class StylesWriterTest extends TestCase
12
{
13
    public function testStylesWriter(): void
14
    {
15
        $spreadsheet = new Spreadsheet();
16
        $sheet = $spreadsheet->getActiveSheet();
0 ignored issues
show
Unused Code introduced by
The assignment to $sheet is dead and can be removed.
Loading history...
17
18
        $writer = new XlsxWriter($spreadsheet);
19
        $writer->createStyleDictionaries();
20
        $writerStyle = new XlsxWriter\Style($writer);
21
        $data = $writerStyle->writeStyles($spreadsheet);
22
        self::assertStringContainsString(
23
            '<fonts count="1"><font><b val="0"/><i val="0"/><strike val="0"/><u val="none"/><sz val="11"/><color rgb="FF000000"/><name val="Calibri"/></font></fonts>',
24
            $data
25
        );
26
        $spreadsheet->disconnectWorksheets();
27
    }
28
}
29