Passed
Push — master ( 115e39...72a36a )
by Mark
10:46
created

DefaultFontTest::testDefaultConditionalFont()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;
4
5
use PhpOffice\PhpSpreadsheet\IOFactory;
6
use PHPUnit\Framework\TestCase;
7
8
class DefaultFontTest extends TestCase
9
{
10
    public function testDefaultConditionalFont(): void
11
    {
12
        // default fill pattern for a conditional style where the filltype is not defined
13
        $filename = 'tests/data/Reader/XLSX/pr2050cf-fill.xlsx';
14
        $reader = IOFactory::createReader('Xlsx');
15
        $spreadsheet = $reader->load($filename);
16
17
        $style = $spreadsheet->getActiveSheet()->getConditionalStyles('A1')[0]->getStyle();
18
        self::assertSame('9C0006', $style->getFont()->getColor()->getRGB());
19
        self::assertNull($style->getFont()->getName());
20
        self::assertNull($style->getFont()->getSize());
21
    }
22
}
23