mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-12 11:06:28 +00:00
ec4098c8fd
While we might never be able to have 100% of our code strict, we can at the very least do it for all of our tests. This ensures that our tests are using our API with the types as intended by the test author, and not silently be cast to what our API requires.
28 lines
926 B
PHP
28 lines
926 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
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();
|
|
}
|
|
}
|