PhpSpreadsheet/tests/PhpSpreadsheetTests
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
..
Calculation Remove @throws comment 2020-05-16 20:33:25 +09:00
Cell Addition cell datatype tests (#1303) 2020-01-03 23:44:38 +01:00
Chart Custom color for pie and donut charts 2018-12-10 18:43:55 +11:00
Collection - Create unit test (#944) 2019-04-15 21:39:11 +02:00
Custom Test fixes for PHP 7.4 stricter behaviour 2019-09-20 16:22:08 -07:00
Functional All writers can write to stream 2020-05-16 20:12:28 +09:00
Helper Replace migration tool with RectorPHP 2020-05-02 12:34:50 +09:00
Reader Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
Shared Upgrad PHP deps 2020-04-27 19:29:45 +09:00
Style Upgrad PHP deps 2020-04-27 19:29:45 +09:00
Worksheet Upgrad PHP deps 2020-04-27 19:29:45 +09:00
Writer Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
DocumentGeneratorTest.php Remove @throws comment 2020-05-16 20:33:25 +09:00
IOFactoryTest.php Add test for IOFactory::load 2019-11-17 18:39:38 +01:00
ReferenceHelperTest.php Upgrad PHP deps 2020-04-27 19:29:45 +09:00
SettingsTest.php Upgrad PHP deps 2020-04-27 19:29:45 +09:00
SpreadsheetTest.php Upgrad PHP deps 2020-04-27 19:29:45 +09:00