mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-15 04:26:25 +00:00
f1a61c4c6b
Phpstan level 10 reports an enormous number of errors. So does the excluded missingType.iterableValue. I do not plan to introduce either any time soon. But I will submit piecemeal changes from time to time. Changes will be mostly limited to phpdoc type declarations.
43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
|
|
use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;
|
|
|
|
class Issue4049Test extends AbstractFunctional
|
|
{
|
|
public function testColorScale(): void
|
|
{
|
|
$xlsxFile = 'tests/data/Reader/XLSX/issue.4049.xlsx';
|
|
$reader = new Xlsx();
|
|
$oldSpreadsheet = $reader->load($xlsxFile);
|
|
$spreadsheet = $this->writeAndReload($oldSpreadsheet, 'Xlsx');
|
|
$oldSpreadsheet->disconnectWorksheets();
|
|
$sheet = $spreadsheet->getActiveSheet();
|
|
$conditionals = $sheet->getConditionalStylesCollection();
|
|
self::assertCount(1, $conditionals);
|
|
self::assertSame('E9:E14', array_keys($conditionals)[0]);
|
|
$cond1 = $conditionals['E9:E14'];
|
|
self::assertCount(1, $cond1);
|
|
self::assertSame('colorScale', $cond1[0]->getConditionType());
|
|
$colorScale = $cond1[0]->getColorScale();
|
|
self::assertNotNull($colorScale);
|
|
$min = $colorScale->getMinimumConditionalFormatValueObject();
|
|
self::assertNotNull($min);
|
|
self::assertSame('formula', $min->getType());
|
|
self::assertSame('25', $min->getCellFormula());
|
|
|
|
self::assertNull($colorScale->getMidpointConditionalFormatValueObject());
|
|
|
|
$max = $colorScale->getMaximumConditionalFormatValueObject();
|
|
self::assertNotNull($max);
|
|
self::assertSame('max', $max->getType());
|
|
self::assertNull($max->getValue());
|
|
|
|
$spreadsheet->disconnectWorksheets();
|
|
}
|
|
}
|