-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4101 from oleibman/issue4099
Ods Reader Allow Omission of Some Page Settings Tags
- Loading branch information
Showing
4 changed files
with
47 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpOffice\PhpSpreadsheetTests\Reader\Ods; | ||
|
||
use PhpOffice\PhpSpreadsheet\Reader\Ods as OdsReader; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class Issue4099Test extends TestCase | ||
{ | ||
private string $file = 'tests/data/Reader/Ods/issue.4099.ods'; | ||
|
||
public function testNoHeaderFooterStyle(): void | ||
{ | ||
// header-style and footer-style are missing in styles.xml | ||
$zipFile = 'zip://' . $this->file . '#styles.xml'; | ||
$contents = (string) file_get_contents($zipFile); | ||
self::assertStringContainsString('page-layout ', $contents); | ||
self::assertStringNotContainsString('header-style', $contents); | ||
self::assertStringNotContainsString('footer-style', $contents); | ||
$reader = new OdsReader(); | ||
$spreadsheet = $reader->load($this->file); | ||
$sheet = $spreadsheet->getActiveSheet(); | ||
self::assertSame('FirstCell', $sheet->getCell('A1')->getValue()); | ||
$spreadsheet->disconnectWorksheets(); | ||
} | ||
} |
Binary file not shown.