Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader/Xml/ArrayFormulaTest.php
T
Owen Leibman 826451937e Better Definitions for Mixed Parameters and Values Part 4 of Many
Continuing work started with PR #4016, PR #4026, and PR #4060. Improve documentation within program by making explicit what types of values are allowed for variables described as "mixed". In order to avoid broken functionality, this is done mainly through doc-blocks. This will get us closer to Phpstan Level 9, but many changes will be needed before we can consider that.

After this PR, 231 changes remain, all in src/Calculation.
2024-08-24 22:08:13 -07:00

27 lines
1.0 KiB
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xml;
use PhpOffice\PhpSpreadsheet\Cell\DataType;
use PhpOffice\PhpSpreadsheet\Reader\Xml;
use PHPUnit\Framework\TestCase;
class ArrayFormulaTest extends TestCase
{
public function testArrayFormulaReader(): void
{
$filename = 'tests/data/Reader/Xml/ArrayFormula.xml';
$reader = new Xml();
$spreadsheet = $reader->load($filename);
$sheet = $spreadsheet->getActiveSheet();
self::assertSame(DataType::TYPE_FORMULA, $sheet->getCell('B1')->getDataType());
self::assertSame(['t' => 'array', 'ref' => 'B1:B3'], $sheet->getCell('B1')->getFormulaAttributes());
self::assertSame('=CONCATENATE(A1:A3,"-",C1:C3)', strtoupper($sheet->getCell('B1')->getValueString()));
self::assertSame('a-1', $sheet->getCell('B1')->getOldCalculatedValue());
self::assertSame('b-2', $sheet->getCell('B2')->getValue());
self::assertSame('c-3', $sheet->getCell('B3')->getValue());
$spreadsheet->disconnectWorksheets();
}
}