PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions
oleibman 346bad1b1d
Fix for Issue 2042 (SUM Partially Broken) (#2045)
As issue #2042 documents, SUM behaves differently with invalid strings depending on whether they come from a cell or are used as literals in the formula. SUM is not alone in this regard; COUNTA is another function within this behavior, and the solution to this one is modeled on COUNTA. New tests are added for SUM, and the resulting tests are duplicated to confirm correct behavior for both cells and literals.

Samples 16 (CSV), 17 (Html), and 21 (PDF) were adversely affected by this problem. 17 and 21 were immediately fixed, but 16 had another problem - Excel was not interpreting the UTF8 currency symbols correctly, even though the file was saved with a BOM. After some experimenting, it appears that the `sep=;` line generated by setExcelCompatibility(true) causes Excel to mis-handle the file. This seems like a bug - there is apparently no way to save a UTF-8 CSV with non-ASCII characters which specifies a non-standard separator which Excel will open correctly. I don't know if this is a recent change or if it is just the case that nobody noticed this problem till now. So, I changed Sample 16 to use setUseBom rather than setExcelCompatibility, which solved its problem. I then added new tests for setExcelCompatibility, with documentation of this problem.
2021-05-03 18:31:01 +02:00
..
Database Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
DateTime DateTimeExcel - Change Names of funcWhatever to evaluate (#2015) 2021-04-24 18:56:58 +02:00
Engineering Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Financial Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Logical Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
LookupRef Improved Support for INDIRECT, ROW, and COLUMN Functions (#2004) 2021-04-20 22:16:21 +02:00
MathTrig Fix for Issue 2042 (SUM Partially Broken) (#2045) 2021-05-03 18:31:01 +02:00
Statistical Start work on refactoring the last of the Excel Statistical functions (#2033) 2021-04-29 14:34:50 +02:00
TextData Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Web Initial implementation of the URLENCODE() web function (#2031) 2021-04-28 17:10:36 +02:00