PhpSpreadsheet/tests/PhpSpreadsheetTests
oleibman de5f450856
Data Validations Referencing Another Sheet (#2265)
See issues #1432 and #2149. Data validations on an Xlsx worksheet can be specified in two manners - one (henceforth "internal") if a list is specified from the same sheet, and a different one (henceforth "external") if a list is specified from a different sheet. Xlsx worksheet reader formerly processed only the internal format; PR #2150 fixed this so that both would be processed correctly on read. However, Xlsx worksheet writer outputs data validators only in the internal format, and that does not work for external data validations; it appears, however, that internal data validations can be specified in external format.

This PR changes Xlsx worksheet writer to use only the external format. Somewhat surprisingly, this must come after most of the other XML tags that constitute a worksheet. It shares this characteristic (and XML tag) with conditional formatting. The new test case DataValidator2Test includes a worksheet which has both internal and external data validation, as well as conditional formatting.

There is some additional namespacing work supporting Data Validations that needs to happen on Xlsx reader. Since that is substantially unchanged with this PR, that work will happen in a future namespacing phase, probably phase 2. However, there are some non-namespace-related changes to Xlsx reader in this PR:
- Cell DataValidation adds support for a new property sqref, which is initialized through Xlsx reader using a setSqref method. If not initialized at write time, the code will work as it did before the introduction of this property. In particular, before this change, data validation applied to an entire column (as in the sample spreadsheet) would be applied only through the last populated row. In addition, this also allows a user to extend a Data Validation over a range of cells rather than just a single cell; the new method is added to the documentation.
- The topLeft property had formerly been used only for worksheets which use "freeze panes". However, as luck would have it, the sample dataset provided to demonstrate the Data Validations problem uses topLeft without freeze panes, slightly affecting the view when the spreadsheet is initially opened; PhpSpreadsheet will now do so as well.

It is worth noting issue #2262, which documents a problem with the hasValidValue method involving the calculation engine. That problem existed before this PR, and I do not yet have a handle on how it might be fixed.
2021-08-24 08:58:38 -07:00
..
Calculation 2 Tests vs. Scrutinizer/Phpstan 2021-07-01 11:15:02 +02:00
Cell Data Validations Referencing Another Sheet (#2265) 2021-08-24 08:58:38 -07:00
Chart DocBlock Changes for Chart/Title 2021-07-02 14:33:43 -07:00
Collection Resolve Deprecated setMethods() call when Mocking for tests (#1925) 2021-03-15 14:50:05 +01:00
Custom Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Document Correct Some Problems Which Will Show Up for PHP8.1 (#2191) 2021-06-29 19:54:08 +02:00
Features/AutoFilter/Xlsx Issue 2216 resolve office365 auto filter structure move (#2218) 2021-07-12 03:19:40 +02:00
Functional Html Reader Comments (#2235) 2021-08-05 08:40:13 -07:00
Helper Improve Identification of Samples in Coverage Report (#2153) 2021-06-11 22:29:44 +02:00
Reader Fix Reading XLSX files without styles.xml throws an exception. (#2247) 2021-08-16 05:05:32 -07:00
Shared Tweaks to Input File Validation (#2217) 2021-07-24 20:44:04 -07:00
Style fix: Set font size to 10 when given 0 2021-05-29 11:17:25 +02:00
Worksheet Now That SettingsTest Is Well-Behaved 2021-06-30 13:15:20 -07:00
Writer Csv Handling of Booleans (and an 8.1 Deprecation) (#2232) 2021-08-04 07:00:17 -07:00
DefinedNameFormulaTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
DefinedNameTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
DocumentGeneratorTest.php Move documentation builder to infra so that it isn't included in non `--dev` composer downloads 2021-05-28 22:35:37 +02:00
HashTableTest.php Improve Coverage for HashTable, Fix Clone 2021-05-30 13:03:37 +02:00
IOFactoryTest.php Tweaks to Input File Validation (#2217) 2021-07-24 20:44:04 -07:00
LocaleGeneratorTest.php Fix phpcs, phpstan and scrutinizer issues 2021-05-28 22:35:37 +02: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 Fix SettingsTest 2021-06-30 11:33:35 -07:00
SpreadsheetTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00