PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader/Xlsx
Owen Leibman ecb4a7fe27 DocBlock Changes for Chart/Title
This is a leftover Scrutinizer change, but it needed more attention than most others. Chart/Title DocBlocks define caption as `null|string`. However, in the wild, Excel usually presents the caption as an array, and not an array of strings but rather of RichText items. I am not sure why an array is needed since a RichText item can contain many text runs, but things are what they are.

Reader/Xlsx/ChartTitleTest reads a spreadsheet with the captions stored as a RichText array. Since it performs array operations on something the DocBlock says cannot be an array, Scrutinizer objects, although not seriously enough to fail the module. Phpstan also objects; its objection is silenced with an annotation. Aside from this test, there are other tests which do set the caption to a string, and Excel seems to handle that without a problem. So, I have changed the DocBlock to specify `array|RichText|String`. I have dropped null as a possibility; nullstring will do equally well.

Because getCaption can now return multiple datatypes, I think a new function which can return the text portion of the entire caption as a single string is needed. I have added it. This simplifies the test named above, and some code in Writer/Html. The latter is not part of unit testing because the version of JpGraph found in Composer is too antiquated. I verified the Html change manually by running samples/Chart/32_Chart_read_write_HTML.php using a recent version of JpGraph. It was as a result of this test that I uncovered issue #2203. I did not see anything about Charts in docs, so did not add a description of the new function there.

Phpstan is happy with the changes. We'll see how Scrutinizer feels when I push it.
2021-07-02 14:33:43 -07:00
..
AbsolutePathTest.php Remove unnecessary changes. Added test 2021-04-19 11:25:48 +01:00
AutoFilterTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
ChartsTitleTest.php DocBlock Changes for Chart/Title 2021-07-02 14:33:43 -07:00
CondNumFmtTest.php Move Reader Xlsx Tests from Reader to Reader/Xlsx Try 2 2021-06-17 09:45:11 -07:00
ConditionalFormattingDataBarXlsxTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
ConditionalTest.php #984 fix php-cs-fixer warnings 2021-05-11 12:44:40 +02:00
DefaultFillTest.php Resolve issue with conditional font size set to zero in PHP8 (#2073) 2021-05-07 12:53:59 +02:00
DefaultFontTest.php Resolve issue with conditional font size set to zero in PHP8 (#2073) 2021-05-07 12:53:59 +02:00
NamedRangeTest.php Fix for 3 Issues Involving ReadXlsx and NamedRange (#1742) 2020-12-10 18:08:10 +01:00
Namespace.Issue2109bTest.php Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
Namespace.Openpyxl35Test.php Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
NamespaceNonStdTest.php Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
NamespacePurlTest.php Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
NamespaceStdTest.php Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
OddColumnReadFilter.php Move Reader Xlsx Tests from Reader to Reader/Xlsx Try 2 2021-06-17 09:45:11 -07:00
PageSetupTest.php Stricter visibility 2020-07-19 12:30:31 +09:00
PropertiesTest.php Document Properties - Coverage and 32-bit-safe Timestamps (#2113) 2021-05-30 13:55:58 +02:00
SheetsXlsxChartTest.php Move Reader Xlsx Tests from Reader to Reader/Xlsx Try 2 2021-06-17 09:45:11 -07:00
URLImageTest.php When image source is a URL, store the URL for use during extraction. (#2072) 2021-06-24 10:50:44 +02:00
WorksheetInfoNamesTest.php Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
Xlsx2Test.php Move Reader Xlsx Tests from Reader to Reader/Xlsx Try 2 2021-06-17 09:45:11 -07:00
XlsxTest.php Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00