Mostly Docs and Tests

Also support for Xml format.
This commit is contained in:
oleibman
2024-06-21 21:55:05 -07:00
parent 3a690a755c
commit ef2b5b9e00
13 changed files with 410 additions and 52 deletions
@@ -0,0 +1,26 @@
<?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')->getValue()));
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();
}
}