PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader/Xlsx
oleibman c0809b0c6c
Fix Spreadsheet Copy, Disable Clone, Improve Coverage (#2951)
* Fix Spreadsheet Copy, Disable Clone, Improve Coverage

This PR was supposed to be merely to increase coverage in Spreadsheet. However, in doing so, I discovered that neither clone nor copy worked correctly. Neither had been covered in the test suite. Copy not only did not work, it broke the source spreadsheet as well. I tried to debug and got nowhere; I even tried using myclabs/deep-copy which is already in use in the test suite, but it failed as well. However, write and reload ought to work just fine for copy. It can't be used for clone; however, since copy does what clone ought to do, there's no reason why clone needs to be used, so __clone is changed to throw an exception if attempted.

One other source change was needed, an obvious bug where an if condition uses 'or' when it should use 'and'. Also, one docblock declaration needed a change. Aside from that, the rest of this PR is test cases, and overall coverage passes 89% for the first time.

* Clone is Okay After All

But copy wasn't, changing it to just return clone. Perhaps save and reload will be needed instead at some point, but not yet.

* An Error I Cannot Reproduce

PHP8.1 unit test says error because GdImage can't be serialized. I can't reproduce this error on any of my test systems. I have no idea why GdImage is even involved. Using try/catch to see if it helps.

* Weird Failures in Github

I thought restoring clone was a good idea. That left me in a state where, after one change, copy/clone no longer worked on Github (unable to reproduce on any of my test systems). After a second change, copy worked but clone didn't, again unable to reproduce. So, reverting to original version - copy does save and reload, clone throws exception.
2022-07-28 07:03:26 -07:00
..
AbsolutePathTest.php
AutoFilter2Test.php Coverage Improvements (#2859) 2022-06-01 08:29:56 -07:00
AutoFilterEvaluateTest.php
AutoFilterTest.php
ChartSheetTest.php Add unit tests for ChartSheet reading 2022-05-16 13:30:30 +02:00
ColorTabTest.php
CommentTest.php
CondNumFmtTest.php
ConditionalFormattingDataBarXlsxTest.php
ConditionalTest.php
CoverageGapsTest.php
DataValidationBooleanValue.php
DefaultFillTest.php
DefaultFontTest.php
DrawingOneCellAnchorTest.php
EmptyFileTest.php
ExplicitDateTest.php
HiddenWorksheetTest.php Add Hidden Worksheet unit tests for other Readers 2022-05-24 14:40:45 +02:00
HyperlinkTest.php
InvalidFileTest.php
Issue2301Test.php Big Memory Leak in One Test (#2958) 2022-07-23 07:46:32 -07:00
Issue2331Test.php
Issue2362Test.php
Issue2387Test.php
Issue2450Test.php
Issue2488Test.php
Issue2490Test.php
Issue2494Test.php
Issue2501Test.php
Issue2516Test.php
Issue2542Test.php
Issue2778Test.php Real Errors Identified in Calculation by Scrutinizer (#2774) 2022-04-30 19:13:17 -07:00
Issue2885Test.php Ignore square-$-brackets prefix in format string (#2886) 2022-06-15 14:55:17 -07:00
NamedRangeTest.php
NamespaceIssue2109bTest.php
NamespaceNonStdTest.php
NamespaceOpenpyxl35Test.php
NamespacePurlTest.php
NamespaceStdTest.php
OctothorpeTest.php
OddColumnReadFilter.php
PageSetup2Test.php Coverage Improvements (#2859) 2022-06-01 08:29:56 -07:00
PageSetupTest.php
PropertiesTest.php
RibbonTest.php Fix Spreadsheet Copy, Disable Clone, Improve Coverage (#2951) 2022-07-28 07:03:26 -07:00
RichTextTest.php
SharedFormulaTest.php
SheetsXlsxChartTest.php Move Gridlines from Chart to Axis (#2923) 2022-07-07 21:48:12 -07:00
URLImageTest.php Change and Re-enable URLImageTest (#2844) 2022-05-21 08:07:59 -07:00
VerticalAlignTest.php
WorksheetInfoNamesTest.php Unit tests for listWorksheetNames() and listWorksheetInfo() with a ChartSheet 2022-05-17 16:11:53 +02:00
Xlsx2Test.php
XlsxRootZipFilesTest.php
XlsxTest.php