mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-15 04:26:25 +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.
36 lines
985 B
PHP
36 lines
985 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;
|
|
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class Issue2450Test extends TestCase
|
|
{
|
|
public function testIssue2450(): void
|
|
{
|
|
// Style specified as GENERAL rather than General.
|
|
$filename = 'tests/data/Reader/XLSX/issue.2450.xlsx';
|
|
$reader = IOFactory::createReader('Xlsx');
|
|
$spreadsheet = $reader->load($filename);
|
|
$sheet = $spreadsheet->getActiveSheet();
|
|
$birthYears = [
|
|
'C2' => $sheet->getCell('C2')->getFormattedValue(),
|
|
'C3' => $sheet->getCell('C3')->getFormattedValue(),
|
|
'C4' => $sheet->getCell('C4')->getFormattedValue(),
|
|
];
|
|
self::assertSame(
|
|
[
|
|
'C2' => '1932',
|
|
'C3' => '1964',
|
|
'C4' => '1988',
|
|
],
|
|
$birthYears
|
|
);
|
|
|
|
$spreadsheet->disconnectWorksheets();
|
|
}
|
|
}
|