PhpSpreadsheet/tests/PhpSpreadsheetTests/Functional
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
..
AbstractFunctional.php Read printing area correctly when skipping some sheets 2018-02-25 19:40:11 +01:00
ActiveSheetTest.php Fix for Xls writer wrong selected cells and active sheet 2020-03-02 17:50:46 +07:00
ColumnWidthTest.php Column dimensions are read by Reader\Xlsx 2018-08-06 10:33:27 +09:00
CommentsTest.php Fix Xlsx loaded an extra empty comment for each real comment 2018-05-26 11:19:12 +09:00
ConditionalStopIfTrueTest.php Adding option to stop at a conditional styling, if it matches 2018-01-07 22:45:51 +09:00
ConditionalTextTest.php Save Excel 2010+ Functions Properly 2020-05-18 12:37:35 +09:00
DrawingImageHyperlinkTest.php Remove unnecessary docs 2018-07-15 13:23:46 +09:00
EnclosureTest.php Test classes must ends with `Test` 2018-01-02 00:53:28 +09:00
FreezePaneTest.php Fix active cell when freeze pane is used 2020-03-02 18:11:37 +07:00
HtmlCommentsTest.php Support for cell comments in HTML writer and reader 2018-01-07 21:51:48 +09:00
MergedCellsTest.php Test classes must ends with `Test` 2018-01-02 00:53:28 +09:00
PrintAreaTest.php Fix print area parser for XLSX reader 2018-10-28 14:37:05 +11:00
ReadBlankCellsTest.php CS Fixes (#962) 2019-04-15 22:49:51 +02:00
ReadFilterTest.php Xlsx reader do not read rows and columns filtered out in readFilter at all 2018-05-26 13:30:21 +09:00
SelectedCellsTest.php Fix for Xls writer wrong selected cells and active sheet 2020-03-02 17:50:46 +07:00
StreamTest.php All writers can write to stream 2020-05-16 20:12:28 +09:00
TypeAttributePreservationTest.php Allow to run an entire folder of tests 2020-05-17 18:35:55 +09:00
WorkbookViewAttributesTest.php Support workbook view attributes for Xlsx format 2018-06-24 20:15:38 +09:00