From b082849b1773aca72d5634b938c795eb87f6c555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bl=C3=A4ul?= Date: Sat, 25 Nov 2017 12:33:09 +0100 Subject: [PATCH] Added tests for files starting with a byte order mark (BOM) --- .../UTF-16LE_with_BOM_and_sep_row.csv | Bin 0 -> 326 bytes .../example_files/UTF-8_with_BOM_and_sep_row.csv | 5 +++++ tests/methods/parse_test.php | 10 ++++++++++ 3 files changed, 15 insertions(+) create mode 100644 tests/example_files/UTF-16LE_with_BOM_and_sep_row.csv create mode 100644 tests/example_files/UTF-8_with_BOM_and_sep_row.csv diff --git a/tests/example_files/UTF-16LE_with_BOM_and_sep_row.csv b/tests/example_files/UTF-16LE_with_BOM_and_sep_row.csv new file mode 100644 index 0000000000000000000000000000000000000000..f8d713bdf1b9ebe01845f940ca934d20bef993b6 GIT binary patch literal 326 zcmYjM(F%e<5S)j73i^Sb`~k(&jwBHjKfss3_b5mZlT7;D{-l~+eTZXs=5~*nx$kGf z6(b7d*kXexI#$nFPB!6;fo#M~*4yO9-31k2>HD3O5=$kSB*aDn9Ho|=_k#D5*hmhK zy;aEWk>P+4DH1ruR9B41JbOZPJgR+ydIf0dI~c2RCmYx`nassertEquals($this->_get_magazines_data(), $this->csv->data); } + public function test_sep_row_auto_detection_UTF8() { + $this->csv->auto(__DIR__ . '/../example_files/UTF-8_with_BOM_and_sep_row.csv'); + $this->assertEquals($this->_get_magazines_data(), $this->csv->data); + } + + public function test_sep_row_auto_detection_UTF16() { + $this->csv->auto(__DIR__ . '/../example_files/UTF-16LE_with_BOM_and_sep_row.csv'); + $this->assertEquals($this->_get_magazines_data(), $this->csv->data); + } + public function test_single_column() { $this->csv->auto(__DIR__ . '/../example_files/single_column.csv'); $expected = [