forked from PHPOffice/PhpSpreadsheet
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General Style Specified in Uppercase in Input Xlsx
Fix PHPOffice#2450. Treat input style GENERAL as if it were expected upper/lowercase.
- Loading branch information
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
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(); | ||
$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(); | ||
} | ||
} |
Binary file not shown.