Added 'single_row' test data for issue #99

Took example documented in #100. Thanks, @tunecino!
This commit is contained in:
Christian Bläul
2017-11-03 21:28:00 +01:00
committed by Fonata
parent 1db4b02e9e
commit bd2031582d
2 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
SMS
0444
5555
6606
7777
1 SMS
2 0444
3 5555
4 6606
5 7777

View File

@@ -29,13 +29,25 @@ class parse_test extends PHPUnit_Framework_TestCase {
private function parse_repetitive_string($content) {
$this->csv->delimiter = ';';
$this->csv->heading = FALSE;
$this->csv->heading = false;
$success = $this->csv->parse(str_repeat($content . ';', 500));
$this->assertEquals(TRUE, $success);
$this->assertEquals(true, $success);
$row = array_pop($this->csv->data);
$expected_data = array_fill(0, 500, $content);
$expected_data [] = '';
$this->assertEquals($expected_data, $row);
}
public function test_single_row() {
$this->csv->auto(__DIR__ . '/../example_files/single_row.csv');
$expected = [
['SMS' => '0444'],
['SMS' => '5555'],
['SMS' => '6606'],
['SMS' => '7777'],
];
$this->assertEquals($expected, $this->csv->data);
}
}