Passed
Pull Request — master (#4508)
by Owen
12:23
created

StylesWriterTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testStylesWriter() 0 13 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
17
        $writer = new XlsxWriter($spreadsheet);
18
        $writer->createStyleDictionaries();
19
        $writerStyle = new XlsxWriter\Style($writer);
20
        $data = $writerStyle->writeStyles($spreadsheet);
21
        self::assertStringContainsString(
22
            '<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>',
23
            $data
24
        );
25
        $spreadsheet->disconnectWorksheets();
26
    }
27
}
28