Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve issue with conditional font size set to zero in PHP8 (#2073)
* Let's see if the tests now pass against PHP8; output file looks to be good * Font can't be both superscript and subscript at the same time, so we use if/else rather than if/if
- Loading branch information
Mark Baker
committed
May 7, 2021
1 parent
115e39a
commit 72a36a5
Showing
3 changed files
with
30 additions
and
6 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,22 @@ | ||
<?php | ||
|
||
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx; | ||
|
||
use PhpOffice\PhpSpreadsheet\IOFactory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class DefaultFontTest extends TestCase | ||
{ | ||
public function testDefaultConditionalFont(): void | ||
{ | ||
// default fill pattern for a conditional style where the filltype is not defined | ||
$filename = 'tests/data/Reader/XLSX/pr2050cf-fill.xlsx'; | ||
$reader = IOFactory::createReader('Xlsx'); | ||
$spreadsheet = $reader->load($filename); | ||
|
||
$style = $spreadsheet->getActiveSheet()->getConditionalStyles('A1')[0]->getStyle(); | ||
self::assertSame('9C0006', $style->getFont()->getColor()->getRGB()); | ||
self::assertNull($style->getFont()->getName()); | ||
self::assertNull($style->getFont()->getSize()); | ||
} | ||
} |