mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-05 15:10:04 +00:00
378beac8f2
Fix #3369. The parser had failed to account for `TRUE` and `FALSE` when supplied as arguments to a function. I had hoped to be able to do something about its inability to handle defined names as well. I failed. I think another section might need to be added to the Writer output which specifies the defined names. I haven't yet located any suitable documentation.
26 lines
900 B
PHP
26 lines
900 B
PHP
<?php
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Writer\Xls;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;
|
|
|
|
class BooleanLiteralTest extends AbstractFunctional
|
|
{
|
|
public function testBooleanLiteral(): void
|
|
{
|
|
// Issue 3369 - Xls Writer Parser unable to handle
|
|
// TRUE (or FALSE) when specified as function arguments.
|
|
$formula = '=AND(true,true(),fAlse,false())';
|
|
$spreadsheet = new Spreadsheet();
|
|
$spreadsheet->setActiveSheetIndex(0);
|
|
$spreadsheet->getActiveSheet()->setCellValue('A1', $formula);
|
|
|
|
$robj = $this->writeAndReload($spreadsheet, 'Xls');
|
|
$spreadsheet->disconnectWorksheets();
|
|
$sheet0 = $robj->setActiveSheetIndex(0);
|
|
self::assertSame(strtoupper($formula), $sheet0->getCell('A1')->getValue());
|
|
$robj->disconnectWorksheets();
|
|
}
|
|
}
|