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

Issue4099Test::testNoHeaderFooterStyle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 13
rs 9.9332
cc 1
nc 1
nop 0
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