corrected regex to fit all given enclosures. Added test for single enclosure

This commit is contained in:
Susann Sgorzaly
2018-02-26 08:55:51 +01:00
parent aaefe2a480
commit 68b849a37b
2 changed files with 11 additions and 1 deletions

View File

@@ -63,4 +63,14 @@ class DataRowCountTest extends TestCase {
$this->csv->load_data($sInput);
$this->assertEquals(3, $this->csv->getTotalDataRowCount());
}
public function testGetTotalRowCountSingleEnclosure() {
$this->csv->heading = false;
$this->csv->enclosure = "'";
$sInput = "86545235689,a\r\n34365587654,b\r\n13469874576,\'c\r\nd\'";
$this->csv->load_data($sInput);
$this->assertEquals(3, $this->csv->getTotalDataRowCount());
}
}