PhpSpreadsheet/tests/data
Owen Leibman 4f6d4af396
Save Excel 2010+ Functions Properly
For functions introduced in Excel 2010 and beyond, Excel saves them
in formulas with the xlfn_ prefix. PhpSpreadsheet does not do this;
as a result, when a spreadsheet so created is opened, the cells
which use the new functions display a #NAME? error.
This the cause of bug report 1246:
https://github.com/PHPOffice/PhpSpreadsheet/issues/1246
This change corrects that problem when the Xlsx writer encounters
a 2010+ formula for a cell or a conditional style. A new class
Writer/Xlsx/Xlfn, with 2 static methods,
is introduced to facilitate this change.

As part of the testing for this, I found some additional problems.
When an unknown function name is used, Excel generates a #NAME? error.
However, when an unknown function is used in PhpSpreadsheet:
  - if there are no parameters, it returns #VALUE!, which is wrong
  - if there are parameters, it throws an exception, which is horrible
Both of these situations will now return #NAME?
Tests have been added for these situations.

The MODE (and MODE.SNGL) function is not quite in alignment with Excel.
MODE(3, 3, 4, 4) returns 3 in both Excel and PhpSpreadsheet.
However, MODE(4, 3, 3, 4) returns 4 in Excel, but 3 in PhpSpreadsheet.
Both situations will now match Excel's result.
Also, Excel allows its parameters for MODE to be an array,
but PhpSpreadsheet did not; it now will.
There had not been any tests for MODE. Now there are.

The SHEET and SHEETS functions were introduced in Excel 2013,
but were not introduced in PhpSpreadsheet. They are now introduced
as DUMMY functions so that they can be parsed appropriately.

Finally, in common with the "rate" changes for which I am
creating a pull request at the same time as this one:
samples/Basic/13_CalculationCyclicFormulae
PhpUnit started reporting an error like "too much regression".
The test deals with an infinite cyclic formula, and allowed
the calculation engine to run for 100 cycles. The actual number of cycles
seems irrelevant for the purpose of this test. I changed it to 15,
and PhpUnit no longer complains.
2020-05-18 12:37:35 +09:00
..
Calculation Save Excel 2010+ Functions Properly 2020-05-18 12:37:35 +09:00
Cell Additional cell datatype unit tests (#1301) 2020-01-03 23:29:53 +01:00
Functional/TypeAttributePreservation Avoid losing calculated value type 2018-03-03 11:51:06 +01:00
Reader Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
Shared Xls file threw exception during open by Xls reader 2018-10-07 18:49:01 +11:00
Style Complex number mask for integers containing a single dot (#1227) 2019-10-30 22:54:06 +01:00
Writer Support to read and write unsupported data for XLSX 2018-05-12 11:47:46 +09:00
CalculationBinaryComparisonOperation.php Refactor tests data from custom format to PHP 2016-08-16 21:00:19 +09:00
CellAbsoluteCoordinate.php Sheet title can contain exclamation mark (in formulas) 2018-10-03 12:52:51 +09:00
CellAbsoluteReference.php Sheet title can contain exclamation mark (in formulas) 2018-10-03 12:52:51 +09:00
CellBuildRange.php Use proper syntax for variadic functions 2017-01-23 15:01:20 +09:00
CellCoordinates.php Use proper syntax for variadic functions 2017-01-23 15:01:20 +09:00
CellExtractAllCellReferencesInRange.php Ranges across Z and AA columns incorrectly threw an exception 2018-06-11 22:54:11 +09:00
CellGetRangeBoundaries.php Use proper syntax for variadic functions 2017-01-23 15:01:20 +09:00
CellMergeRangesInCollection.php Fix cell ranges causing coordinate merge error 2018-01-22 12:26:37 +09:00
CellRangeBoundaries.php Use proper syntax for variadic functions 2017-01-23 15:01:20 +09:00
CellRangeDimension.php Use proper syntax for variadic functions 2017-01-23 15:01:20 +09:00
CellSplitRange.php Use proper syntax for variadic functions 2017-01-23 15:01:20 +09:00
ColumnIndex.php Consistent `stringFromColumnIndex()` and `columnIndexFromString()` 2017-11-26 15:29:08 +09:00
ColumnString.php Use proper syntax for variadic functions 2017-01-23 15:01:20 +09:00
CoordinateIsRange.php Fix cell ranges causing coordinate merge error 2018-01-22 12:26:37 +09:00