mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-20 14:50:53 +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.
29 lines
832 B
PHP
29 lines
832 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
|
|
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
use PhpOffice\PhpSpreadsheet\NamedRange;
|
|
use PhpOffice\PhpSpreadsheet\Shared\File;
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class DefinedNameConfusedForCellTest extends TestCase
|
|
{
|
|
public function testDefinedName(): void
|
|
{
|
|
$obj = new Spreadsheet();
|
|
$sheet0 = $obj->setActiveSheetIndex(0);
|
|
$sheet0->setCellValue('A1', 2);
|
|
$obj->addNamedRange(new NamedRange('A1A', $sheet0, 'A1'));
|
|
$sheet0->setCellValue('B1', '=2*A1A');
|
|
$writer = IOFactory::createWriter($obj, 'Xlsx');
|
|
$filename = File::temporaryFilename();
|
|
$writer->save($filename);
|
|
self::assertTrue(true);
|
|
unlink($filename);
|
|
}
|
|
}
|