Improved comment and test data to show how the offset is counted.

This commit is contained in:
Christian Bläul
2018-03-02 17:26:07 +01:00
parent abecaf1b5d
commit 9d7ccab20f
3 changed files with 81 additions and 26 deletions

View File

@@ -153,31 +153,6 @@ class ParseTest extends TestCase {
$this->assertEquals($expected, $this->csv->data_types);
}
public function testDataArrayKeysWhenSettingOffsetWithHeading() {
$this->csv->offset = 2;
$this->csv->auto(__DIR__ . '/fixtures/datatype.csv');
$expected = [
'title',
'isbn',
'publishedAt',
'published',
'count',
'price'
];
$this->assertEquals($expected, array_keys($this->csv->data[0]));
}
public function testDataArrayKeysWhenSettingOffsetWithoutHeading() {
$this->csv->heading = false;
$this->csv->offset = 2;
$this->csv->auto(__DIR__ . '/fixtures/datatype.csv');
$expected = range(0, 5, 1);
$this->assertEquals($expected, array_keys($this->csv->data[0]));
}
protected function _get_magazines_data() {
return [
[