PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader
oleibman 7517cdd008
Improve Coverage for CSV (#1475)
I believe that both CSV Reader and Writer are 100% covered now.

There were some errors uncovered during development.

The reader specifically permits encodings other than UTF-8 to be used.
However, fgetcsv will not properly handle other encodings.
I tried replacing it with fgets/iconv/strgetcsv, but that could not
handle line breaks within a cell, even for UTF-8.
This is, I'm sure, a very rare use case.
I eventually handled it by using php://memory to hold the translated
file contents for non-UTF8. There were no tests for this situation,
and now there are (probably too many).

"Contiguous" read was not handle correctly. There is a file
in samples which uses it. It was designed to read a large sheet,
and split it into three. The first sheet was corrrect, but the
second and third were almost entirely empty. This has been corrected,
and the sample code was adapted into a formal test with assertions
to confirm that it works as designed.

I made a minor documentation change. Unlike HTML, where you never
need a BOM because you can declare the encoding in the file,
a CSV with non-ASCII characters must explicitly include a BOM
for Excel to handle it correctly. This was explained in the Reading CSV
section, but was glossed over in the Writing CSV section, which I
have updated.
2020-05-17 18:15:18 +09:00
..
Security Upgrad PHP deps 2020-04-27 19:29:45 +09:00
Xlsx Fix XLSX file loading with autofilter containing '$' 2020-03-02 18:43:27 +07:00
CondNumFmtTest.php Handle ConditionalStyle NumberFormat When Reading Xlsx File (#1296) 2020-01-04 00:10:41 +01:00
CsvContiguousFilter.php Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
CsvContiguousTest.php Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
CsvTest.php Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
HtmlTest.php Upgrad PHP deps 2020-04-27 19:29:45 +09:00
OddColumnReadFilter.php Fix column names if read filter calls in XLSX reader skip columns 2018-12-10 20:00:26 +11:00
OdsTest.php Migrate away from deprecated PHPUnit asserts 2019-07-25 10:15:53 -07:00
XlsTest.php Xls file threw exception during open by Xls reader 2018-10-07 18:49:01 +11:00
Xlsx2Test.php Upgrad PHP deps 2020-04-27 19:29:45 +09:00
XlsxTest.php Upgrad PHP deps 2020-04-27 19:29:45 +09:00
XmlTest.php phpcs cleanup 2018-11-20 08:18:35 +01:00