Passed
Pull Request — master (#4101)
by Owen
16:16 queued 59s
created

Issue4099Test   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testNoHeaderFooterStyle() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpOffice\PhpSpreadsheetTests\Reader\Ods;
6
7
use PhpOffice\PhpSpreadsheet\Reader\Ods as OdsReader;
8
use PHPUnit\Framework\TestCase;
9
10
class Issue4099Test extends TestCase
11
{
12
    private string $file = 'tests/data/Reader/Ods/issue.4099.ods';
13
14
    public function testNoHeaderFooterStyle(): void
15
    {
16
        // header-style and footer-style are missing in styles.xml
17
        $zipFile = 'zip://' . $this->file . '#styles.xml';
18
        $contents = (string) file_get_contents($zipFile);
19
        self::assertStringContainsString('page-layout ', $contents);
20
        self::assertStringNotContainsString('header-style', $contents);
21
        self::assertStringNotContainsString('footer-style', $contents);
22
        $reader = new OdsReader();
23
        $spreadsheet = $reader->load($this->file);
24
        $sheet = $spreadsheet->getActiveSheet();
25
        self::assertSame('FirstCell', $sheet->getCell('A1')->getValue());
26
        $spreadsheet->disconnectWorksheets();
27
    }
28
}
29