PhpSpreadsheet/tests/PhpSpreadsheetTests
oleibman 497a934374
Fix for 3 Issues Involving ReadXlsx and NamedRange (#1742)
* Fix for 3 Issues Involving ReadXlsx and NamedRange

Issues #1686 and #1723, which provide sample spreadsheets, are probably
solved by this ticket. Issue #1730 is also probably solved, but I have
no way to verify.

There are two problems with how PhpSpreadsheet is handling things now.
Although the first problem is much less severe, and isn't really a factor
in the issues named above, it is helpful to get it out of the way first.
If you define a named range in Excel, and then delete the sheet where
the range exists, Excel saves the range as #REF!. If there is a cell which
references the range, it will similarly have the value #REF! when you open
the Excel file.
Currently, PhpSpreadsheet discards the #REF! definition, so a cell which
references the range will appear as #NAME? rather than #REF!.
This PR changes the behavior so that PhpSpreadsheet retains the #REF!
definition, and cells which reference it will appear as #REF!.

The second problem is the more severe, and is, I believe, responsible
for the 3 issues identified above.
If you define a named range and the sheet on which the range is defined
does not exist at the time, Excel will save the range as something like:

'[1]Unknown Sheet'!$A$1

If a cell references such a range, Excel will again display #REF!.
PhpSpreadsheet currently throws an Exception when it encounters
such a definition while reading the file. This PR changes
the behavior so that PhpSpreadsheet saves the definition as #REF!,
and cells which reference it will behave similarly.

For the record, I will note that Excel does not magically recalculate when a
missing sheet is subsequently added, despite the fact that the reference
might now become resolvable. PhpSpreadsheet behaves likewise.

* Remove Dead Code in Test

Identified it after push but before merge.
2020-12-10 18:08:10 +01:00
..
Calculation More unit tests for statistical functions, including a bugfix to LARGE() (#1601) 2020-07-29 23:56:37 +02:00
Cell Restoring State After Static Changes in Tests (#1571) 2020-07-15 13:23:00 +02:00
Chart Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Collection Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Custom Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Functional Improve Coverage in src/PhpSpreadsheet 2020-11-27 06:50:01 -08:00
Helper Drop Travis 2020-11-26 11:10:52 +09:00
Reader Fix for 3 Issues Involving ReadXlsx and NamedRange (#1742) 2020-12-10 18:08:10 +01:00
Shared Restoring State After Static Changes in Tests (#1571) 2020-07-15 13:23:00 +02:00
Style Add exportArray Method for Styles (#1580) 2020-10-26 20:56:24 +01:00
Worksheet Stricter visibility 2020-07-19 12:30:31 +09:00
Writer Resolve XSS Vulnerability in the HTML Writer (#1719) 2020-11-19 11:59:57 +01:00
DefinedNameFormulaTest.php Improve Coverage in src/PhpSpreadsheet 2020-11-27 06:50:01 -08:00
DefinedNameTest.php Changes for Scrutinizer 2020-11-27 07:16:23 -08:00
DocumentGeneratorTest.php Improve Coverage in src/PhpSpreadsheet 2020-11-27 06:50:01 -08:00
IOFactoryTest.php Changes for Scrutinizer 2020-11-27 07:16:23 -08:00
NamedFormulaTest.php Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
NamedRangeTest.php Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
ReferenceHelperTest.php Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
SettingsTest.php fixed php8 deprecation warning for libxml_disable_entity_loader() (#1625) 2020-10-08 15:02:14 +02:00
SpreadsheetTest.php Fix for 1735 (Incorrect activeSheetIndex after RemoveSheetByIndex) (#1743) 2020-12-10 18:01:08 +01:00